This commit is contained in:
2025-03-09 01:03:44 +03:30
parent f428892c6d
commit d14f07ba80
8 changed files with 573 additions and 31 deletions
@@ -681,6 +681,375 @@ class XC121SMCCycleHelper : public XCBase
//
};
//
struct X121SMCStrategyConditionParser
{
//
// Props ...
//
// XSAR ...
//
bool isSarBullishOverPeaksGoldenZone;
bool isSarSwitchedToBullishOverPeaksGoldenZone;
bool isSarBearishOverPeaksGoldenZone;
bool isSarSwitchedToBearishOverPeaksGoldenZone;
bool isSarBullishUnderValesGoldenZone;
bool isSarSwitchedToBullishUnderValesGoldenZone;
bool isSarBearishUnderValesGoldenZone;
bool isSarSwitchedToBearishUnderValesGoldenZone;
//
// XMA ...
//
bool isX3MaFastUnderValesGoldenZone;
bool isX3MaFastCrossedUnderValesGoldenZone;
bool isX3MaFastOverPeaksGoldenZone;
bool isX3MaFastCrossedOverPeaksGoldenZone;
//
bool isX3MaInsidePeaksGoldenZone;
bool isX3MaCrossedInsidePeaksGoldenZone;
//
bool isX3MaInsideValesGoldenZone;
bool isX3MaCrossedInsideValesGoldenZone;
//
// XVWAP ...
//
bool isVWapFastUnderValesGoldenZone;
bool isVWapFastCrossedUnderValesGoldenZone;
bool isVWapFastOverPeaksGoldenZone;
bool isVWapFastCrossedOverPeaksGoldenZone;
//
// XHK ...
//
// XRWHK ...
//
bool isRawHKBearishOverPeaksGoldenZone;
bool isRawHKSwitchedToBearishOverPeaksGoldenZone;
bool isRawHKBullishUnderValesGoldenZone;
bool isRawHKSwitchedToBullishUnderValesGoldenZone;
//
// XSMHK ...
//
bool isSMHKBearishOverPeaksGoldenZone;
bool isSMHKSwitchedToBearishOverPeaksGoldenZone;
bool isSMHKBullishUnderValesGoldenZone;
bool isSMHKSwitchedToBullishUnderValesGoldenZone;
//
bool isXVwapMaOverPeaksGoldeZone;
bool isXVwapMaUnderValesGoldeZone;
//
// Constructor ...
X121SMCStrategyConditionParser()
{
Clean();
}
//
// Tools ...
//
void Clean()
{
//
isSarBullishOverPeaksGoldenZone = false;
isSarSwitchedToBullishOverPeaksGoldenZone = false;
isSarBearishOverPeaksGoldenZone = false;
isSarSwitchedToBearishOverPeaksGoldenZone = false;
isSarBullishUnderValesGoldenZone = false;
isSarSwitchedToBullishUnderValesGoldenZone = false;
isSarBearishUnderValesGoldenZone = false;
isSarSwitchedToBearishUnderValesGoldenZone = false;
//
isX3MaFastUnderValesGoldenZone = false;
isX3MaFastCrossedUnderValesGoldenZone = false;
isX3MaFastOverPeaksGoldenZone = false;
isX3MaFastCrossedOverPeaksGoldenZone = false;
//
isX3MaInsidePeaksGoldenZone = false;
isX3MaCrossedInsidePeaksGoldenZone = false;
//
isX3MaInsideValesGoldenZone = false;
isX3MaCrossedInsideValesGoldenZone = false;
//
isVWapFastUnderValesGoldenZone = false;
isVWapFastCrossedUnderValesGoldenZone = false;
isVWapFastOverPeaksGoldenZone = false;
isVWapFastCrossedOverPeaksGoldenZone = false;
//
isRawHKBearishOverPeaksGoldenZone = false;
isRawHKSwitchedToBearishOverPeaksGoldenZone = false;
isRawHKBullishUnderValesGoldenZone = false;
isRawHKSwitchedToBullishUnderValesGoldenZone = false;
//
isSMHKBearishOverPeaksGoldenZone = false;
isSMHKSwitchedToBearishOverPeaksGoldenZone = false;
isSMHKBullishUnderValesGoldenZone = false;
isSMHKSwitchedToBullishUnderValesGoldenZone = false;
//
isXVwapMaOverPeaksGoldeZone = false;
isXVwapMaUnderValesGoldeZone = false;
//
ZeroMemory(this);
}
//
void Parse(
X121Conditions &conditions //
)
{
//
Clean();
//
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
//
// XSAR ...
//
isSarBullishOverPeaksGoldenZone =
conditions.isSarBullish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarSwitchedToBullishOverPeaksGoldenZone =
conditions.isSarSwitchedToBullish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarBearishOverPeaksGoldenZone =
conditions.isSarBearish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarSwitchedToBearishOverPeaksGoldenZone =
conditions.isSarSwitchedToBearish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarBullishUnderValesGoldenZone =
conditions.isSarBullish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarSwitchedToBullishUnderValesGoldenZone =
conditions.isSarSwitchedToBullish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarBearishUnderValesGoldenZone =
conditions.isSarBearish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarSwitchedToBearishUnderValesGoldenZone =
conditions.isSarSwitchedToBearish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// X3MA ...
//
isX3MaFastUnderValesGoldenZone =
conditions.x3maFastBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isX3MaFastCrossedUnderValesGoldenZone =
isX3MaFastUnderValesGoldenZone &&
conditions.x3maFastBuffer[pIDX] >= conditions.valesGoldenBuffer[pIDX];
//
isX3MaFastOverPeaksGoldenZone =
conditions.x3maFastBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isX3MaFastCrossedOverPeaksGoldenZone =
isX3MaFastOverPeaksGoldenZone &&
conditions.x3maFastBuffer[pIDX] <= conditions.peaksGoldenBuffer[pIDX];
//
isX3MaInsidePeaksGoldenZone =
//
conditions.x3maMin < conditions.peaksBuffer[cIDX] &&
conditions.x3maMin > conditions.peaksGoldenBuffer[cIDX] &&
//
conditions.x3maMax < conditions.peaksBuffer[cIDX] &&
conditions.x3maMax > conditions.peaksGoldenBuffer[cIDX]
//
;
//
isX3MaCrossedInsidePeaksGoldenZone =
isX3MaInsidePeaksGoldenZone &&
!(
//
conditions.x3maMin < conditions.peaksBuffer[pIDX] &&
conditions.x3maMin > conditions.peaksGoldenBuffer[pIDX] &&
//
conditions.x3maMax < conditions.peaksBuffer[pIDX] &&
conditions.x3maMax > conditions.peaksGoldenBuffer[pIDX]
//
);
//
isX3MaInsideValesGoldenZone =
//
conditions.x3maMin > conditions.valesBuffer[cIDX] &&
conditions.x3maMin < conditions.valesGoldenBuffer[cIDX] &&
//
conditions.x3maMax > conditions.valesBuffer[cIDX] &&
conditions.x3maMax < conditions.valesGoldenBuffer[cIDX]
//
;
isX3MaCrossedInsideValesGoldenZone =
isX3MaInsideValesGoldenZone &&
!(
//
conditions.x3maMin > conditions.valesBuffer[pIDX] &&
conditions.x3maMin < conditions.valesGoldenBuffer[pIDX] &&
//
conditions.x3maMax > conditions.valesBuffer[pIDX] &&
conditions.x3maMax < conditions.valesGoldenBuffer[pIDX]
//
);
//
// XVWAP ...
//
isVWapFastUnderValesGoldenZone =
conditions.vwapFastBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isVWapFastCrossedUnderValesGoldenZone =
isVWapFastUnderValesGoldenZone &&
conditions.vwapFastBuffer[pIDX] >= conditions.valesGoldenBuffer[pIDX];
//
isVWapFastOverPeaksGoldenZone =
conditions.vwapFastBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isVWapFastCrossedOverPeaksGoldenZone =
isVWapFastOverPeaksGoldenZone &&
conditions.vwapFastBuffer[pIDX] <= conditions.peaksGoldenBuffer[pIDX];
//
// XHK ...
//
// XRWHK ...
//
isRawHKBearishOverPeaksGoldenZone =
conditions.isRawHKBearish &&
conditions.xhkRawHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isRawHKSwitchedToBearishOverPeaksGoldenZone =
conditions.isRawHKSwitchedToBearish &&
conditions.xhkRawHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isRawHKBullishUnderValesGoldenZone =
conditions.isRawHKBullish &&
conditions.xhkRawLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isRawHKSwitchedToBullishUnderValesGoldenZone =
conditions.isRawHKSwitchedToBullish &&
conditions.xhkRawLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// XSMHK ...
//
isSMHKBearishOverPeaksGoldenZone =
conditions.isSMHKBearish &&
conditions.xhkSMHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSMHKSwitchedToBearishOverPeaksGoldenZone =
conditions.isSMHKSwitchedToBearish &&
conditions.xhkSMHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSMHKBullishUnderValesGoldenZone =
conditions.isSMHKBullish &&
conditions.xhkSMLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSMHKSwitchedToBullishUnderValesGoldenZone =
conditions.isSMHKSwitchedToBullish &&
conditions.xhkSMLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// COMBINED Conditions ...
//
isXVwapMaOverPeaksGoldeZone =
//
(
//
(isX3MaFastOverPeaksGoldenZone &&
isVWapFastCrossedOverPeaksGoldenZone)
//
||
//
(isVWapFastOverPeaksGoldenZone &&
isX3MaFastCrossedOverPeaksGoldenZone)
//
)
//
;
//
isXVwapMaUnderValesGoldeZone =
//
(
//
(isX3MaFastUnderValesGoldenZone &&
isVWapFastCrossedUnderValesGoldenZone)
//
||
//
(isVWapFastUnderValesGoldenZone &&
isX3MaFastCrossedUnderValesGoldenZone)
//
)
//
;
}
//
};
//
struct X121SMCStrategySignalProviderData
{