diff --git a/Documents/BKP/workingZone.zone.box.mq5 b/Documents/BKP/workingZone.zone.box.mq5 index 25f4aaaf..90510180 100644 --- a/Documents/BKP/workingZone.zone.box.mq5 +++ b/Documents/BKP/workingZone.zone.box.mq5 @@ -1699,6 +1699,692 @@ if (useSenario1) Print("Has Inside Box ..."); } + //////////////////////////////////////////////////////////////////////// + + // + XOBFVG waitingZones[]; + XOBFVG unavailableZones[]; + + //////////////////////////////////////////////////////////////////////// + + // + bool DetectZone( + X121SMCStrategySignalProviderData & provider // + ) + { + // + bool result = false; + + // + result = IsValid() && + provider.IsValid(); + if (!result) + { + return result; + } + + // + int idx = -1; + int count = 0; + bool has = false; + datetime cTime = TimeCurrent(); + + // + XOBFVG obFVG; + XBoxZone obBox; + XBoxZone fvgBox; + XBoxZone supplyBox; + XBoxZone demandBox; + + // + XCFVG *fvg = NULL; + XCOrderBlock *ob = NULL; + XCSupplyZone *supply = NULL; + XCDemandZone *demand = NULL; + + // + // Check New Supply Zone Detection ... + bool hasNewSupply = + Contains( + X_SUPPLY_ZONE_DETECTED, + provider.consolidationPoiEvents // + ); + if (hasNewSupply) + { + // + idx = GetYoungest(provider + .consolidationState + .supplyZones // + ); + has = IsValidIndex(idx); + if (has) + { + // + supply = provider + .consolidationState + .supplyZones[idx]; + has = ToBox( + supplyBox, + supply // + ); + if (has) + { + // + supply.To(cTime); + supplyBox.to = cTime; + hasNewSupply = supplyBox.IsValid(); + } + } + } + + // + // Check New Demand Zone Detection ... + bool hasNewDemand = + Contains( + X_DEMAND_ZONE_DETECTED, + provider + .consolidationPoiEvents // + ); + if (hasNewDemand) + { + // + idx = GetYoungest(provider + .consolidationState + .demandZones // + ); + has = IsValidIndex(idx); + if (has) + { + // + demand = provider + .consolidationState + .demandZones[idx]; + has = ToBox( + demandBox, + demand // + ); + if (has) + { + // + demand.To(cTime); + demandBox.to = cTime; + hasNewDemand = demandBox.IsValid(); + } + } + } + + // + // Check New Fair Value Gap Detection ... + bool hasNewFairValueGap = + Contains( + X_BULLISH_FVG_DETECTED, + provider + .analysePoiEvents // + ) || + Contains( + X_BEARISH_FVG_DETECTED, + provider + .analysePoiEvents // + ); + if (hasNewFairValueGap) + { + // + idx = GetYoungest(provider + .analyseState + .fairValueGaps // + ); + has = IsValidIndex(idx); + if (has) + { + // + fvg = provider + .analyseState + .fairValueGaps[idx]; + has = ToBox( + fvgBox, + fvg // + ); + if (has) + { + // + fvg.To(cTime); + fvgBox.to = cTime; + hasNewFairValueGap = fvgBox.IsValid(); + } + } + } + + // + // Check New Order Block Detection ... + bool hasNewOrderBlock = + Contains( + X_BULLISH_ORDERBLOCK_DETECTED, + provider + .consolidationPoiEvents // + ) || + Contains( + X_BEARISH_ORDERBLOCK_DETECTED, + provider + .consolidationPoiEvents // + ); + if (hasNewOrderBlock) + { + // + idx = GetYoungest(provider + .consolidationState + .orderBlocks // + ); + has = IsValidIndex(idx); + if (has) + { + // + ob = provider + .consolidationState + .orderBlocks[idx]; + has = ToBox( + obBox, + ob // + ); + if (has) + { + // + ob.To(cTime); + obBox.to = cTime; + hasNewOrderBlock = obBox.IsValid(); + } + } + } + + // + // Detect OB FVG ... + if (hasNewOrderBlock) + { + // + XOHCL obStartedBar; + bool isOBStartedBodyOut = false; + bool isOBStarted = ob.IsStarted( + ob.GetDirection(), + obStartedBar, + isOBStartedBodyOut // + ); + + // + has = isOBStarted; + if (has) + { + // + obFVG.ob = ob; + + // + // Select FVGs ... + count = provider + .analyseState + .CountFairValueGaps(); + has = IsValidSize(count); + if (!has) + { + obFVG.Clean(); + } + else + { + // + // Select FVG ... + for (int i = 0; i < count; i++) + { + // + XCFVG *iFVG = provider + .analyseState + .fairValueGaps[i]; + bool isBullish = iFVG.IsBullish(); + + // + XOHCL iStartedBar; + bool isBodyOut = false; + bool isStarted = iFVG.IsStarted( + iFVG.GetDirection(), + iStartedBar, + isBodyOut // + ); + iStartedBar.Clean(); + + // + bool isKindPassed = isStarted && + isBodyOut; + bool isSameDir = iFVG.GetDirection() == ob.GetDirection(); + bool isFromPassed = iFVG.From() >= obStartedBar.time; + bool isPlacePassed = + // + IsInsideOrDiff( + iFVG, + ob // + ) + // + // || + // // + // (isBullish + // ? IsAboveDiff( + // iFVG, + // ob, + // true // Ignore Inside ... + // ) + // : IsBelowDiff( + // iFVG, + // ob, + // true // Ignore Inside ... + // ) + // // + // ) + // + ; + + // + has = isSameDir && + isKindPassed && + isFromPassed && + isPlacePassed; + if (has) + { + obFVG.AddFVG(iFVG); + } + + // + ZeroMemory(iFVG); + } + } + } + + // + has = obFVG.IsValid(); + if (has) + { + // + has = IsExists(obFVG); + if (!has) + { + // + // New Waiting Zone ... + AddRef( + obFVG, + waitingZones // + ); + } + else + { + // + // Check Item Is not Exists ... + idx = FindIndex( + obFVG, + waitingZones // + ); + has = !IsValidIndex(idx); + if (!has) + { + // + // Update Exists Waiting Zone ... + waitingZones[idx].AddFVG(fvg); + } + } + } + + // + obFVG.Clean(); + obStartedBar.Clean(); + } + + // + // + // + + // + bool lookingOthers = false; + if (lookingOthers) + { + // + // Check New Order Block Detection Analyse ... + XBoxZone analyseOBBox; + XCOrderBlock *analyseOB = NULL; + bool hasNewAnalyseOrderBlock = + Contains( + X_BULLISH_ORDERBLOCK_DETECTED, + provider + .analysePoiEvents // + ) || + Contains( + X_BEARISH_ORDERBLOCK_DETECTED, + provider + .analysePoiEvents // + ); + if (hasNewAnalyseOrderBlock) + { + // + idx = GetYoungest(provider + .analyseState + .orderBlocks // + ); + has = IsValidIndex(idx); + if (has) + { + // + analyseOB = provider + .analyseState + .orderBlocks[idx]; + has = ToBox( + analyseOBBox, + analyseOB // + ); + if (has) + { + // + analyseOB.To(cTime); + analyseOBBox.to = cTime; + hasNewAnalyseOrderBlock = analyseOBBox.IsValid(); + } + } + } + + // + // Checking Analyse Order Block ... + if (hasNewAnalyseOrderBlock) + { + // + XOHCL obStartedBar; + bool isOBStartedBodyOut = false; + bool isOBStarted = analyseOB.IsStarted( + analyseOB.GetDirection(), + obStartedBar, + isOBStartedBodyOut // + ); + + // + has = isOBStarted && + isOBStartedBodyOut; + if (has) + { + // + analyseOBBox.from = + obStartedBar.NextAt(); + + // + has = IsExists(analyseOBBox); + if (!has) + { + // + AddRef( + analyseOBBox, + waitingBoxes // + ); + } + } + } + + // + analyseOBBox.Clean(); + ZeroMemory(analyseOB); + } + + // + // + // + + // + result = HasWaitingZones(); + + // + // Cleanup Resources ... + + // + obFVG.Clean(); + obBox.Clean(); + fvgBox.Clean(); + supplyBox.Clean(); + demandBox.Clean(); + + // + ZeroMemory(ob); + ZeroMemory(fvg); + ZeroMemory(supply); + ZeroMemory(demand); + + // + return result; + } + + //////////////////////////////////////////////////////////////////////// + + // + int ValidateWaitingZones( + int barIndex = 0 // + ) + { + // + int result = 0; + + // + bool has = false; + + // + if (barIndex < 0) + { + barIndex = 0; + } + + // + if (barIndex == 0) + { + barIndex = 1; + } + + // + has = IsValid() && + HasWaitingZones(); + if (!has) + { + return result; + } + + // + int removeIDX[]; + result = CountWaitingZones(); + for (int i = 0; i < result; i++) + { + // + has = waitingZones[i].IsValidZone( + barIndex // + ); + if (!has) + { + // + Add( + i, + removeIDX // + ); + + // + AddRef( + waitingZones[i], + unavailableZones // + ); + } + } + + // + has = HasChild(removeIDX); + if (has) + { + // + CleanupArray( + removeIDX, + waitingZones // + ); + } + Clean(removeIDX); + + // + result = CountWaitingZones(); + + // + return result; + } + + //////////////////////////////////////////////////////////////////////// + + // + bool IsExists(XOBFVG & zone) + { + // + bool result = false; + + // + // Check Validation ... + result = zone.IsValid() && + (HasWaitingZones() || + HasUnavailableZones()); + if (!result) + { + return result; + } + + // + int idx = -1; + + // + // Check Index in Waiting Zones ... + idx = FindIndex( + zone, + waitingZones // + ); + result = IsValidIndex(idx); + if (result) + { + return result; + } + + // + // Check Index in Unavailable Zones ... + idx = FindIndex( + zone, + unavailableZones // + ); + result = IsValidIndex(idx); + if (result) + { + return result; + } + + // + return result; + } + + //////////////////////////////////////////////////////////////////////// + + // + Clean(waitingZones); + Clean(unavailableZones); + + // + bool HasWaitingZones() + { + return HasChild(waitingZones); + } + + // + int CountWaitingZones() + { + return ArraySize(waitingZones); + } + + // + bool HasUnavailableZones() + { + return HasChild(unavailableZones); + } + + //////////////////////////////////////////////////////////////////////// + + // + has = HasWaitingZones(); + if (has) + { + // + count = CountWaitingZones(); + for (int i = 0; i < count; i++) + { + waitingZones[i].UpdateTo(value); + } + } + + //////////////////////////////////////////////////////////////////////// + + // + has = HasWaitingZones(); + if (has) + { + // + count = CountWaitingZones(); + for (int i = 0; i < count; i++) + { + // + XCBaseObject *iObjects[]; + int iObjectsCount = drawer.DrawOBFVG( + waitingZones[i], + iObjects, + true, // Draw Order Block ... + true, // Draw Fair Value Gaps ... + true, // Draw All Fair Value Gaps ... + // + true, // Draw OB StartedBar ... + true, // Draw OB ActivatedBar ... + true, // Draw OB BreakedBar ... + true, // Draw OB WorkedBar ... + // + true, // Draw FVG StartedBar ... + true, // Draw FVG ActivatedBar ... + true, // Draw FVG BreakedBar ... + true // Draw FVG WorkedBar ... + // + ); + has = IsValidSize(iObjectsCount); + if (has) + { + // + for (int j = 0; j < iObjectsCount; j++) + { + mDrawnObjects.Add(iObjects[j]); + } + } + + // + // if (drawWaitingZonesBoxArea) + // { + // // + // XBoxZone iBox; + // has = waitingZones[i].ToZone( + // iBox // + // ); + // if (has) + // { + // // + // XCBoxObject *iBoxObj; + // has = drawer.DrawBox( + // iBox, + // iBoxObj // + // ); + // if (has) + // { + // mDrawnObjects.Add(iBoxObj); + // } + // } + + // // + // iBox.Clean(); + // } + } + } + +//////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 b/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 index 467f776a..6261bf62 100644 --- a/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 +++ b/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 @@ -61,9 +61,7 @@ bool IsValid(ENUM_X_CYCLES value) // result = - value != X_CYCLE_NONE || - value != X_CYCLE_TRIGGER || - value != X_CYCLE_VERIFICATION; + value != X_CYCLE_NONE; // return result; @@ -923,6 +921,17 @@ struct X121SMCStrategySignalProviderData // // Props ... + // + // Trigger ... + XPOIState triggerState; + double triggerBullishScore; + double triggerBearishScore; + X121Conditions triggerXConditions; + ENUM_XPOI_EVENTS triggerPoiEvents[]; + XC121SMCCycleHelper *triggerCycleHelper; + ENUM_X_CYCLE_EVENTS triggerCycleEvents[]; + X121SMCCycleConditions triggerConditions; + // // Decision ... XPOIState decisionState; @@ -945,6 +954,17 @@ struct X121SMCStrategySignalProviderData ENUM_X_CYCLE_EVENTS analyseCycleEvents[]; X121SMCCycleConditions analyseConditions; + // + // Verification ... + XPOIState verificationState; + double verificationBullishScore; + double verificationBearishScore; + X121Conditions verificationXConditions; + ENUM_XPOI_EVENTS verificationPoiEvents[]; + XC121SMCCycleHelper *verificationCycleHelper; + ENUM_X_CYCLE_EVENTS verificationCycleEvents[]; + X121SMCCycleConditions verificationConditions; + // // Consolidation ... XPOIState consolidationState; @@ -981,6 +1001,16 @@ struct X121SMCStrategySignalProviderData // Cleanup ... void Clean() { + // + // Trigger ... + triggerState.Clean(); + triggerBullishScore = 0; + triggerBearishScore = 0; + Clean(triggerPoiEvents); + Clean(triggerCycleEvents); + triggerConditions.Clean(); + triggerXConditions.Clean(); + // // Decision ... decisionState.Clean(); @@ -1001,6 +1031,16 @@ struct X121SMCStrategySignalProviderData analyseConditions.Clean(); analyseXConditions.Clean(); + // + // Verification ... + verificationState.Clean(); + verificationBullishScore = 0; + verificationBearishScore = 0; + Clean(verificationPoiEvents); + Clean(verificationCycleEvents); + verificationConditions.Clean(); + verificationXConditions.Clean(); + // // Consolidation ... consolidationState.Clean(); @@ -1029,10 +1069,12 @@ struct X121SMCStrategySignalProviderData Clean(); // - ZeroMemory(decisionCycleHelper); - ZeroMemory(analyseCycleHelper); - ZeroMemory(consolidationCycleHelper); ZeroMemory(visionCycleHelper); + ZeroMemory(triggerCycleHelper); + ZeroMemory(analyseCycleHelper); + ZeroMemory(decisionCycleHelper); + ZeroMemory(verificationCycleHelper); + ZeroMemory(consolidationCycleHelper); // ZeroMemory(this); @@ -1047,8 +1089,10 @@ struct X121SMCStrategySignalProviderData // result = visionCycleHelper != NULL && + triggerCycleHelper != NULL && analyseCycleHelper != NULL && decisionCycleHelper != NULL && + verificationCycleHelper != NULL && consolidationCycleHelper != NULL; // @@ -1058,8 +1102,10 @@ struct X121SMCStrategySignalProviderData // // Initialize ... bool Init( + XC121SMCCycleHelper *_triggerCycleHelper, XC121SMCCycleHelper *_decisionCycleHelper, XC121SMCCycleHelper *_analyseCycleHelper, + XC121SMCCycleHelper *_verificationCycleHelper, XC121SMCCycleHelper *_consolidationCycleHelper, XC121SMCCycleHelper *_visionCycleHelper // ) @@ -1072,8 +1118,10 @@ struct X121SMCStrategySignalProviderData result = // _visionCycleHelper != NULL && + _triggerCycleHelper != NULL && _analyseCycleHelper != NULL && _decisionCycleHelper != NULL && + _verificationCycleHelper != NULL && _consolidationCycleHelper != NULL // ; @@ -1084,8 +1132,10 @@ struct X121SMCStrategySignalProviderData // visionCycleHelper = _visionCycleHelper; + triggerCycleHelper = _triggerCycleHelper; analyseCycleHelper = _analyseCycleHelper; decisionCycleHelper = _decisionCycleHelper; + verificationCycleHelper = _verificationCycleHelper; consolidationCycleHelper = _consolidationCycleHelper; // @@ -1124,6 +1174,28 @@ struct X121SMCStrategySignalProviderData return result; } + // + // Trigger ... + result = triggerCycleHelper.GetConditions( + triggerCycleEvents, + triggerPoiEvents, + triggerConditions, + barIndex, + loopback // + ); + if (!result) + { + // + Clean(triggerPoiEvents); + Clean(triggerCycleEvents); + + // + triggerConditions.Clean(); + + // + return result; + } + // // Decision ... result = decisionCycleHelper.GetConditions( @@ -1136,10 +1208,11 @@ struct X121SMCStrategySignalProviderData if (!result) { // + Clean(triggerPoiEvents); Clean(decisionPoiEvents); + Clean(triggerCycleEvents); + triggerConditions.Clean(); Clean(decisionCycleEvents); - - // decisionConditions.Clean(); // @@ -1158,16 +1231,44 @@ struct X121SMCStrategySignalProviderData if (!result) { // + Clean(triggerPoiEvents); Clean(analysePoiEvents); Clean(decisionPoiEvents); - - // + Clean(triggerCycleEvents); Clean(analyseCycleEvents); + triggerConditions.Clean(); + analyseConditions.Clean(); Clean(decisionCycleEvents); + decisionConditions.Clean(); // + return result; + } + + // + // Verification ... + result = verificationCycleHelper.GetConditions( + verificationCycleEvents, + verificationPoiEvents, + verificationConditions, + barIndex, + loopback // + ); + if (!result) + { + // + Clean(triggerPoiEvents); + Clean(analysePoiEvents); + Clean(decisionPoiEvents); + Clean(triggerCycleEvents); + Clean(analyseCycleEvents); + triggerConditions.Clean(); analyseConditions.Clean(); + Clean(decisionCycleEvents); decisionConditions.Clean(); + Clean(verificationPoiEvents); + Clean(verificationCycleEvents); + verificationConditions.Clean(); // return result; @@ -1185,18 +1286,20 @@ struct X121SMCStrategySignalProviderData if (!result) { // + Clean(triggerPoiEvents); Clean(analysePoiEvents); Clean(decisionPoiEvents); - Clean(consolidationPoiEvents); - - // + Clean(triggerCycleEvents); Clean(analyseCycleEvents); - Clean(decisionCycleEvents); - Clean(consolidationCycleEvents); - - // + triggerConditions.Clean(); analyseConditions.Clean(); + Clean(decisionCycleEvents); decisionConditions.Clean(); + Clean(verificationPoiEvents); + Clean(consolidationPoiEvents); + Clean(verificationCycleEvents); + verificationConditions.Clean(); + Clean(consolidationCycleEvents); consolidationConditions.Clean(); // @@ -1216,20 +1319,22 @@ struct X121SMCStrategySignalProviderData { // Clean(visionPoiEvents); + Clean(triggerPoiEvents); Clean(analysePoiEvents); - Clean(decisionPoiEvents); - Clean(consolidationPoiEvents); - - // Clean(visionCycleEvents); - Clean(analyseCycleEvents); - Clean(decisionCycleEvents); - Clean(consolidationCycleEvents); - - // visionConditions.Clean(); + Clean(decisionPoiEvents); + Clean(triggerCycleEvents); + Clean(analyseCycleEvents); + triggerConditions.Clean(); analyseConditions.Clean(); + Clean(decisionCycleEvents); decisionConditions.Clean(); + Clean(verificationPoiEvents); + Clean(consolidationPoiEvents); + Clean(verificationCycleEvents); + verificationConditions.Clean(); + Clean(consolidationCycleEvents); consolidationConditions.Clean(); // @@ -1238,17 +1343,28 @@ struct X121SMCStrategySignalProviderData // // Cycles POI States ... - decisionState = decisionConditions.state; - analyseState = analyseConditions.state; - consolidationState = consolidationConditions.state; visionState = visionConditions.state; + triggerState = triggerConditions.state; + analyseState = analyseConditions.state; + decisionState = decisionConditions.state; + verificationState = verificationConditions.state; + consolidationState = consolidationConditions.state; // // Cycle X121Conditions ... - decisionXConditions = decisionConditions.x121Conditions; - analyseXConditions = analyseConditions.x121Conditions; - consolidationXConditions = consolidationConditions.x121Conditions; visionXConditions = visionConditions.x121Conditions; + triggerXConditions = triggerConditions.x121Conditions; + analyseXConditions = analyseConditions.x121Conditions; + decisionXConditions = decisionConditions.x121Conditions; + verificationXConditions = verificationConditions.x121Conditions; + consolidationXConditions = consolidationConditions.x121Conditions; + + // + // Trigger ... + triggerXConditions.GenerateScore( + triggerBullishScore, + triggerBearishScore // + ); // // Decision ... @@ -1264,6 +1380,13 @@ struct X121SMCStrategySignalProviderData analyseBearishScore // ); + // + // Verification ... + verificationXConditions.GenerateScore( + verificationBullishScore, + verificationBearishScore // + ); + // // Consolidation ... consolidationXConditions.GenerateScore( @@ -2919,7 +3042,7 @@ struct X121SMCStrategyConditionParser X121SMCStrategySignalProviderData &provider, int barIndex = 0, bool forceBarType = false, - bool forceFiboPressure = false, // + bool forceFiboPressure = false // ) { // @@ -3102,7 +3225,7 @@ struct X121SMCStrategyConditionParser // Update Inside Box From and To ... // Based on Breaked ... insideBox.from = insideBox.to; - insideBox.to = cTime; + insideBox.to = TimeCurrent(); // // Detect Breaked Box Direction ... diff --git a/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 b/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 index 6a3c2a0e..e8972054 100644 --- a/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 @@ -225,8 +225,11 @@ class XCX121SMCXWZSignalDetector : public XCBase if (hasWaitingBoxes) { // - workingZone - .ValidateWaitingBoxes(zIndex); + // Validate Working Zone Waiting Boxes ... + workingZone.ValidateWaitingBoxes(zIndex); + + // + // Double Check Has Waiting Boxes or not ... hasWaitingBoxes = workingZone.HasWaitingBoxes(); } @@ -260,10 +263,7 @@ class XCX121SMCXWZSignalDetector : public XCBase } // - // Start Draw ... - // - - // + // Update Models To Time ... UpdateTo(cTime); // @@ -281,10 +281,6 @@ class XCX121SMCXWZSignalDetector : public XCBase ); } - // - // End Draw ... - // - // // Detect Signal Box ... hasSignalBox = @@ -304,21 +300,21 @@ class XCX121SMCXWZSignalDetector : public XCBase // // Remove Signal Box from UnAvailable Box ... // if Exists ... - bool hasUnAvailableBoxes = workingZone - .HasUnavailableBoxes(); - if (hasUnAvailableBoxes) + bool hasBreakedBoxes = workingZone + .HasBreakedBoxes(); + if (hasBreakedBoxes) { // int idx = FindIndex( signalBox, - workingZone.unavailableBoxes // + workingZone.breakedBoxes // ); bool has = IsValidIndex(idx); if (has) { // ArrayRemove( - workingZone.unavailableBoxes, + workingZone.breakedBoxes, idx, 1 // ); @@ -352,20 +348,6 @@ class XCX121SMCXWZSignalDetector : public XCBase // // - // - // Remove InValidate Boxes ... - if (hasWaitingBoxes) - { - // - // Validate Waiting Boxes ... - workingZone.ValidateWaitingBoxes(zIndex); - hasWaitingBoxes = workingZone.HasWaitingBoxes(); - } - - // - // - // - // // Cleanup Signal if UnApproved ... if (!hasSignalBox) diff --git a/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 b/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 index 046ceaa6..6aff05df 100644 --- a/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 @@ -69,12 +69,9 @@ struct X121SMCStrategyXWZWorkingZone XCSupplyZone *supplyZone; XCDemandZone *demandZone; - // - XOBFVG waitingZones[]; - XOBFVG unavailableZones[]; - // XBoxZone waitingBoxes[]; + XBoxZone breakedBoxes[]; XBoxZone unavailableBoxes[]; // @@ -89,9 +86,96 @@ struct X121SMCStrategyXWZWorkingZone } // - // Tools ... + // Properties ... + + /** + * Check Working Zone has Supply Zone as Upper Boundary ... + * + * @return ( bool ) + */ + bool HasSupplyZone() + { + return supplyZone != NULL && + supplyZone.IsValid(); + } + + /** + * Check Working Zone has Demand Zone as Lower Boundary ... + * + * @return ( bool ) + */ + bool HasDemandZone() + { + return demandZone != NULL && + demandZone.IsValid(); + } + + /** + * Check Working Zone has Waiting Boxes or not ... + * + * @return ( bool ) + */ + bool HasWaitingBoxes() + { + return HasChild(waitingBoxes); + } + + /** + * Count Working Zone's Waiting Boxes ... + * + * @return ( int ) + */ + int CountWaitingBoxes() + { + return ArraySize(waitingBoxes); + } + + /** + * Check Working Zone has Breaked Boxes or not ... + * + * @return ( bool ) + */ + bool HasBreakedBoxes() + { + return HasChild(breakedBoxes); + } + + /** + * Count Working Zone's Breaked Boxes ... + * + * @return ( int ) + */ + int CountBreakedBoxes() + { + return ArraySize(breakedBoxes); + } + + /** + * Check Working Zone has Unavailable Boxes or not ... + * + * @return ( bool ) + */ + bool HasUnavailableBoxes() + { + return HasChild(unavailableBoxes); + } + + /** + * Count Working Zone's Unavailable Boxes ... + * + * @return ( int ) + */ + int CountUnavailableBoxes() + { + return ArraySize(unavailableBoxes); + } // + // Tools ... + + /** + * Cleanup Model ... + */ void Clean() { // @@ -103,12 +187,9 @@ struct X121SMCStrategyXWZWorkingZone symbol = NULL; period = NULL; - // - Clean(waitingZones); - Clean(unavailableZones); - // Clean(waitingBoxes); + Clean(breakedBoxes); Clean(unavailableBoxes); // @@ -120,7 +201,11 @@ struct X121SMCStrategyXWZWorkingZone mWorkingZoneObjects.Clear(); } - // + /** + * Validate Model ... + * + * @return ( bool ) + */ bool IsValid() { // @@ -143,7 +228,16 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // + /** + * Initialize Working Zone ... + * + * @param _symbol: String ... + * @param _period: ENUM_TIMEFRAMES member ... + * @param barIndex: int ... + * @param provider: X121SMCStrategySignalProviderData instance reference ... + * + * @return ( bool ) + */ bool Init( string _symbol, ENUM_TIMEFRAMES _period, @@ -280,449 +374,15 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // - bool DetectZone( - X121SMCStrategySignalProviderData &provider // - ) - { - // - bool result = false; - - // - result = IsValid() && - provider.IsValid(); - if (!result) - { - return result; - } - - // - int idx = -1; - int count = 0; - bool has = false; - datetime cTime = TimeCurrent(); - - // - XOBFVG obFVG; - XBoxZone obBox; - XBoxZone fvgBox; - XBoxZone supplyBox; - XBoxZone demandBox; - - // - XCFVG *fvg = NULL; - XCOrderBlock *ob = NULL; - XCSupplyZone *supply = NULL; - XCDemandZone *demand = NULL; - - // - // Check New Supply Zone Detection ... - bool hasNewSupply = - Contains( - X_SUPPLY_ZONE_DETECTED, - provider.consolidationPoiEvents // - ); - if (hasNewSupply) - { - // - idx = GetYoungest(provider - .consolidationState - .supplyZones // - ); - has = IsValidIndex(idx); - if (has) - { - // - supply = provider - .consolidationState - .supplyZones[idx]; - has = ToBox( - supplyBox, - supply // - ); - if (has) - { - // - supply.To(cTime); - supplyBox.to = cTime; - hasNewSupply = supplyBox.IsValid(); - } - } - } - - // - // Check New Demand Zone Detection ... - bool hasNewDemand = - Contains( - X_DEMAND_ZONE_DETECTED, - provider - .consolidationPoiEvents // - ); - if (hasNewDemand) - { - // - idx = GetYoungest(provider - .consolidationState - .demandZones // - ); - has = IsValidIndex(idx); - if (has) - { - // - demand = provider - .consolidationState - .demandZones[idx]; - has = ToBox( - demandBox, - demand // - ); - if (has) - { - // - demand.To(cTime); - demandBox.to = cTime; - hasNewDemand = demandBox.IsValid(); - } - } - } - - // - // Check New Fair Value Gap Detection ... - bool hasNewFairValueGap = - Contains( - X_BULLISH_FVG_DETECTED, - provider - .analysePoiEvents // - ) || - Contains( - X_BEARISH_FVG_DETECTED, - provider - .analysePoiEvents // - ); - if (hasNewFairValueGap) - { - // - idx = GetYoungest(provider - .analyseState - .fairValueGaps // - ); - has = IsValidIndex(idx); - if (has) - { - // - fvg = provider - .analyseState - .fairValueGaps[idx]; - has = ToBox( - fvgBox, - fvg // - ); - if (has) - { - // - fvg.To(cTime); - fvgBox.to = cTime; - hasNewFairValueGap = fvgBox.IsValid(); - } - } - } - - // - // Check New Order Block Detection ... - bool hasNewOrderBlock = - Contains( - X_BULLISH_ORDERBLOCK_DETECTED, - provider - .consolidationPoiEvents // - ) || - Contains( - X_BEARISH_ORDERBLOCK_DETECTED, - provider - .consolidationPoiEvents // - ); - if (hasNewOrderBlock) - { - // - idx = GetYoungest(provider - .consolidationState - .orderBlocks // - ); - has = IsValidIndex(idx); - if (has) - { - // - ob = provider - .consolidationState - .orderBlocks[idx]; - has = ToBox( - obBox, - ob // - ); - if (has) - { - // - ob.To(cTime); - obBox.to = cTime; - hasNewOrderBlock = obBox.IsValid(); - } - } - } - - // - // Detect OB FVG ... - if (hasNewOrderBlock) - { - // - XOHCL obStartedBar; - bool isOBStartedBodyOut = false; - bool isOBStarted = ob.IsStarted( - ob.GetDirection(), - obStartedBar, - isOBStartedBodyOut // - ); - - // - has = isOBStarted; - if (has) - { - // - obFVG.ob = ob; - - // - // Select FVGs ... - count = provider - .analyseState - .CountFairValueGaps(); - has = IsValidSize(count); - if (!has) - { - obFVG.Clean(); - } - else - { - // - // Select FVG ... - for (int i = 0; i < count; i++) - { - // - XCFVG *iFVG = provider - .analyseState - .fairValueGaps[i]; - bool isBullish = iFVG.IsBullish(); - - // - XOHCL iStartedBar; - bool isBodyOut = false; - bool isStarted = iFVG.IsStarted( - iFVG.GetDirection(), - iStartedBar, - isBodyOut // - ); - iStartedBar.Clean(); - - // - bool isKindPassed = isStarted && - isBodyOut; - bool isSameDir = iFVG.GetDirection() == ob.GetDirection(); - bool isFromPassed = iFVG.From() >= obStartedBar.time; - bool isPlacePassed = - // - IsInsideOrDiff( - iFVG, - ob // - ) - // - // || - // // - // (isBullish - // ? IsAboveDiff( - // iFVG, - // ob, - // true // Ignore Inside ... - // ) - // : IsBelowDiff( - // iFVG, - // ob, - // true // Ignore Inside ... - // ) - // // - // ) - // - ; - - // - has = isSameDir && - isKindPassed && - isFromPassed && - isPlacePassed; - if (has) - { - obFVG.AddFVG(iFVG); - } - - // - ZeroMemory(iFVG); - } - } - } - - // - has = obFVG.IsValid(); - if (has) - { - // - has = IsExists(obFVG); - if (!has) - { - // - // New Waiting Zone ... - AddRef( - obFVG, - waitingZones // - ); - } - else - { - // - // Check Item Is not Exists ... - idx = FindIndex( - obFVG, - waitingZones // - ); - has = !IsValidIndex(idx); - if (!has) - { - // - // Update Exists Waiting Zone ... - waitingZones[idx].AddFVG(fvg); - } - } - } - - // - obFVG.Clean(); - obStartedBar.Clean(); - } - - // - // - // - - // - bool lookingOthers = false; - if (lookingOthers) - { - // - // Check New Order Block Detection Analyse ... - XBoxZone analyseOBBox; - XCOrderBlock *analyseOB = NULL; - bool hasNewAnalyseOrderBlock = - Contains( - X_BULLISH_ORDERBLOCK_DETECTED, - provider - .analysePoiEvents // - ) || - Contains( - X_BEARISH_ORDERBLOCK_DETECTED, - provider - .analysePoiEvents // - ); - if (hasNewAnalyseOrderBlock) - { - // - idx = GetYoungest(provider - .analyseState - .orderBlocks // - ); - has = IsValidIndex(idx); - if (has) - { - // - analyseOB = provider - .analyseState - .orderBlocks[idx]; - has = ToBox( - analyseOBBox, - analyseOB // - ); - if (has) - { - // - analyseOB.To(cTime); - analyseOBBox.to = cTime; - hasNewAnalyseOrderBlock = analyseOBBox.IsValid(); - } - } - } - - // - // Checking Analyse Order Block ... - if (hasNewAnalyseOrderBlock) - { - // - XOHCL obStartedBar; - bool isOBStartedBodyOut = false; - bool isOBStarted = analyseOB.IsStarted( - analyseOB.GetDirection(), - obStartedBar, - isOBStartedBodyOut // - ); - - // - has = isOBStarted && - isOBStartedBodyOut; - if (has) - { - // - analyseOBBox.from = - obStartedBar.NextAt(); - - // - has = IsExists(analyseOBBox); - if (!has) - { - // - AddRef( - analyseOBBox, - waitingBoxes // - ); - } - } - } - - // - analyseOBBox.Clean(); - ZeroMemory(analyseOB); - } - - // - // - // - - // - result = HasWaitingZones(); - - // - // Cleanup Resources ... - - // - obFVG.Clean(); - obBox.Clean(); - fvgBox.Clean(); - supplyBox.Clean(); - demandBox.Clean(); - - // - ZeroMemory(ob); - ZeroMemory(fvg); - ZeroMemory(supply); - ZeroMemory(demand); - - // - return result; - } - - // + /** + * Detect Signal Boxes ... + * + * @param cycle: ENUM_X_CYCLES member ... + * @param provider: X121SMCStrategySignalProviderData instance reference ... + * @param barIndex: int ... + * + * @return ( bool ) + */ bool DetectSignalBoxes( ENUM_X_CYCLES cycle, X121SMCStrategySignalProviderData &provider, @@ -777,11 +437,19 @@ struct X121SMCStrategyXWZWorkingZone if (result) { // - Copy( - rejections, - waitingBoxes, - false // - ); + for (int i = 0; i < count; i++) + { + // + bool has = IsExists(rejections[i]); + if (!has) + { + // + AddRef( + rejections[i], + waitingBoxes // + ); + } + } } // @@ -801,82 +469,13 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // - int ValidateWaitingZones( - int barIndex = 0 // - ) - { - // - int result = 0; - - // - bool has = false; - - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - if (barIndex == 0) - { - barIndex = 1; - } - - // - has = IsValid() && - HasWaitingZones(); - if (!has) - { - return result; - } - - // - int removeIDX[]; - result = CountWaitingZones(); - for (int i = 0; i < result; i++) - { - // - has = waitingZones[i].IsValidZone( - barIndex // - ); - if (!has) - { - // - Add( - i, - removeIDX // - ); - - // - AddRef( - waitingZones[i], - unavailableZones // - ); - } - } - - // - has = HasChild(removeIDX); - if (has) - { - // - CleanupArray( - removeIDX, - waitingZones // - ); - } - Clean(removeIDX); - - // - result = CountWaitingZones(); - - // - return result; - } - - // + /** + * Validating Waiting Boxes and Detect Breaked Boxes ... + * + * @param barIndex: int ... + * + * @return ( int ) + */ int ValidateWaitingBoxes( int barIndex = 0 // ) @@ -940,7 +539,7 @@ struct X121SMCStrategyXWZWorkingZone // AddRef( iBox, - unavailableBoxes // + breakedBoxes // ); } @@ -968,7 +567,18 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // + /** + * Detect Signal Box Conditions ... + * + * @param box: XBoxZone instance reference, Signalled Box ... + * @param holderBox: XBoxZone instance reference, Signalled Holder Box ... + * @param dir: ENUM_X_DIRECTION member, Specified Signal Direction ... + * @param signalProvider: ENUM_X121SMC_XWZ_PROVIDERS member, Specified Signal Type ... + * @param provider: X121SMCStrategySignalProviderData instance reference ... + * @param barIndex: int ... + * + * @return ( bool ) + */ bool DetectSignalConditions( XBoxZone &box, XBoxZone &holderBox, @@ -1174,54 +784,13 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // - bool IsExists(XOBFVG &zone) - { - // - bool result = false; - - // - // Check Validation ... - result = zone.IsValid() && - (HasWaitingZones() || - HasUnavailableZones()); - if (!result) - { - return result; - } - - // - int idx = -1; - - // - // Check Index in Waiting Zones ... - idx = FindIndex( - zone, - waitingZones // - ); - result = IsValidIndex(idx); - if (result) - { - return result; - } - - // - // Check Index in Unavailable Zones ... - idx = FindIndex( - zone, - unavailableZones // - ); - result = IsValidIndex(idx); - if (result) - { - return result; - } - - // - return result; - } - - // + /** + * Checking a Box Exists in Collections or not ... + * + * @param box: XBoxZone instance reference ... + * + * @return ( bool ) + */ bool IsExists(XBoxZone &box) { // @@ -1231,6 +800,7 @@ struct X121SMCStrategyXWZWorkingZone // Check Validation ... result = box.IsValid() && (HasWaitingBoxes() || + HasBreakedBoxes() || HasUnavailableBoxes()); if (!result) { @@ -1239,36 +809,71 @@ struct X121SMCStrategyXWZWorkingZone // int idx = -1; + bool has = false; // - // Check Index in Waiting Zones ... - idx = FindIndex( - box, - waitingBoxes // - ); - result = IsValidIndex(idx); - if (result) + // Check Index in Waiting Boxes ... + has = HasWaitingBoxes(); + if (has) { - return result; + // + idx = FindIndex( + box, + waitingBoxes // + ); + result = IsValidIndex(idx); + if (result) + { + return result; + } } // - // Check Index in Unavailable Zones ... - idx = FindIndex( - box, - unavailableBoxes // - ); - result = IsValidIndex(idx); - if (result) + // Check Index in Breaked Boxes ... + has = HasBreakedBoxes(); + if (has) { - return result; + // + idx = FindIndex( + box, + breakedBoxes // + ); + result = IsValidIndex(idx); + if (result) + { + return result; + } + } + + // + // Check Index in Unavailable Boxes ... + has = HasUnavailableBoxes(); + if (has) + { + // + idx = FindIndex( + box, + unavailableBoxes // + ); + result = IsValidIndex(idx); + if (result) + { + return result; + } } // return result; } - // + /** + * Check Working Zone is Destroyed or not ... + * + * @param barIndex: int, bar index ... + * @param forPeriod: ENUM_TIMEFRAMES member ... + * + * @return ( bool ) + */ bool IsDestroyed( int barIndex = 0, ENUM_TIMEFRAMES forPeriod = NULL // @@ -1351,7 +956,16 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // + /** + * Detect a Signal Priority forDynamic Risk Reward ratio ... + * + * @param priority: ENUM_X121SMC_XWZ_PRIORITY member, holds Specified position Priority ... + * @param forDir: ENUM_X_DIRECTION member, Specified Position Direction for Priority ... + * @param barIndex: int ... + * @param forPeriod: ENUM_TIMEFRAMES member ... + * + * @return ( bool ) + */ bool DetectPriority( ENUM_X121SMC_XWZ_PRIORITY &priority, ENUM_X_DIRECTION forDir, @@ -1469,7 +1083,13 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // + /** + * Detect Overal Trend of Working Zone ... + * + * @param dir: ENUM_X_DIRECTION member ... + * + * @return ( bool ) + */ bool DetectOveralDirection( ENUM_X_DIRECTION &dir // ) @@ -1575,7 +1195,11 @@ struct X121SMCStrategyXWZWorkingZone return result; } - // + /** + * Update all Collections Members To Time ... + * + * @param value: datetime, Specified To Time ... + */ void UpdateTo(datetime value = NULL) { // @@ -1599,18 +1223,6 @@ struct X121SMCStrategyXWZWorkingZone demandZone.To(value); } - // - has = HasWaitingZones(); - if (has) - { - // - count = CountWaitingZones(); - for (int i = 0; i < count; i++) - { - waitingZones[i].UpdateTo(value); - } - } - // has = HasWaitingBoxes(); if (has) @@ -1626,7 +1238,14 @@ struct X121SMCStrategyXWZWorkingZone // } - // + /** + * Draw Working Zne and all of + * it's Collections and Conditions ... + * + * @param drawSupplyZone: boolean ... + * @param drawDemandZone: boolean ... + * @param drawWaitingZones: boolean ... + */ void Draw( XCPOIDrawer *drawer, bool drawSupplyZone = false, @@ -1858,72 +1477,6 @@ struct X121SMCStrategyXWZWorkingZone // Waiting Zones ... if (drawWaitingZones) { - // - has = HasWaitingZones(); - if (has) - { - // - count = CountWaitingZones(); - for (int i = 0; i < count; i++) - { - // - XCBaseObject *iObjects[]; - int iObjectsCount = drawer.DrawOBFVG( - waitingZones[i], - iObjects, - true, // Draw Order Block ... - true, // Draw Fair Value Gaps ... - true, // Draw All Fair Value Gaps ... - // - true, // Draw OB StartedBar ... - true, // Draw OB ActivatedBar ... - true, // Draw OB BreakedBar ... - true, // Draw OB WorkedBar ... - // - true, // Draw FVG StartedBar ... - true, // Draw FVG ActivatedBar ... - true, // Draw FVG BreakedBar ... - true // Draw FVG WorkedBar ... - // - ); - has = IsValidSize(iObjectsCount); - if (has) - { - // - for (int j = 0; j < iObjectsCount; j++) - { - mDrawnObjects.Add(iObjects[j]); - } - } - - // - // if (drawWaitingZonesBoxArea) - // { - // // - // XBoxZone iBox; - // has = waitingZones[i].ToZone( - // iBox // - // ); - // if (has) - // { - // // - // XCBoxObject *iBoxObj; - // has = drawer.DrawBox( - // iBox, - // iBoxObj // - // ); - // if (has) - // { - // mDrawnObjects.Add(iBoxObj); - // } - // } - - // // - // iBox.Clean(); - // } - } - } - // has = HasWaitingBoxes(); if (has) @@ -1952,72 +1505,6 @@ struct X121SMCStrategyXWZWorkingZone // } - // - // - // - - // - bool HasSupplyZone() - { - return supplyZone != NULL && - supplyZone.IsValid(); - } - - // - bool HasDemandZone() - { - return demandZone != NULL && - demandZone.IsValid(); - } - - // - bool HasWaitingZones() - { - return HasChild(waitingZones); - } - - // - int CountWaitingZones() - { - return ArraySize(waitingZones); - } - - // - bool HasUnavailableZones() - { - return HasChild(unavailableZones); - } - - // - int CounUnavailableZones() - { - return ArraySize(unavailableZones); - } - - // - bool HasWaitingBoxes() - { - return HasChild(waitingBoxes); - } - - // - int CountWaitingBoxes() - { - return ArraySize(waitingBoxes); - } - - // - bool HasUnavailableBoxes() - { - return HasChild(unavailableBoxes); - } - - // - int CountUnavailableBoxes() - { - return ArraySize(unavailableBoxes); - } - // }; diff --git a/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 b/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 index e428c4aa..a2c8cbf5 100644 --- a/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 +++ b/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 @@ -112,8 +112,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy void Destroy() override { // + ZeroMemory(mTriggerCycleHelper); ZeroMemory(mDecisionCycleHelper); ZeroMemory(mAnalyseCycleHelper); + ZeroMemory(mVerificationCycleHelper); ZeroMemory(mConsolidationCycleHelper); ZeroMemory(mVisionCycleHelper); @@ -487,6 +489,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy // // XC121SMCCycleHelper *mTriggerCycleHelper; + XC121SMCCycleHelper *mTriggerCycleHelper; XC121SMCCycleHelper *mDecisionCycleHelper; XC121SMCCycleHelper *mAnalyseCycleHelper; XC121SMCCycleHelper *mVerificationCycleHelper; @@ -509,21 +512,6 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy // bool result = false; - // - // Validate Cycle Helpers ... - result = - // - mVisionCycleHelper != NULL && - mAnalyseCycleHelper != NULL && - mDecisionCycleHelper != NULL && - mConsolidationCycleHelper != NULL - // - ; - if (!result) - { - return result; - } - // bool isBullish = false; bool isBearish = false; @@ -867,7 +855,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy mDecisionCycleHelper = new XC121SMCCycleHelper(); isInited = mDecisionCycleHelper.Init( symbol, - PERIOD_M5, + PERIOD_M1, x121Inputs, requiredPOIS // ); @@ -919,6 +907,63 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy mDecisionCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor); } + // + // Trigger Cycle ... + mTriggerCycleHelper = new XC121SMCCycleHelper(); + isInited = mTriggerCycleHelper.Init( + symbol, + PERIOD_M5, + x121Inputs, + requiredPOIS // + ); + if (isInited) + { + // + // Configure POI Drawer ... + color bullishColor = clrDodgerBlue; + color bearishColor = clrSienna; + + // + // Bars ... + mTriggerCycleHelper.mPOIDrawer.BarBullishColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.BarBearishColor(bearishColor); + + // + // Swings ... + mTriggerCycleHelper.mPOIDrawer.SwingLowColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.SwingHighColor(bearishColor); + + // + // Momentum ... + mTriggerCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor); + + // + // Rejection ... + mTriggerCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor); + + // + // Support and Resistance ... + mTriggerCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor); + + // + // Demand and Supply ... + mTriggerCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor); + + // + // Order Blocks ... + mTriggerCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor); + + // + // Fair Value Gaps ... + mTriggerCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor); + mTriggerCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor); + } + // // Analyse Cycle ... mAnalyseCycleHelper = new XC121SMCCycleHelper(); @@ -976,6 +1021,63 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy mAnalyseCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor); } + // + // Verification Cycle ... + mVerificationCycleHelper = new XC121SMCCycleHelper(); + isInited = mVerificationCycleHelper.Init( + symbol, + PERIOD_M30, + x121Inputs, + requiredPOIS // + ); + if (isInited) + { + // + // Configure POI Drawer ... + color bullishColor = clrDodgerBlue; + color bearishColor = clrSienna; + + // + // Bars ... + mVerificationCycleHelper.mPOIDrawer.BarBullishColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.BarBearishColor(bearishColor); + + // + // Swings ... + mVerificationCycleHelper.mPOIDrawer.SwingLowColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.SwingHighColor(bearishColor); + + // + // Momentum ... + mVerificationCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor); + + // + // Rejection ... + mVerificationCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor); + + // + // Support and Resistance ... + mVerificationCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor); + + // + // Demand and Supply ... + mVerificationCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor); + + // + // Order Blocks ... + mVerificationCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor); + + // + // Fair Value Gaps ... + mVerificationCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor); + mVerificationCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor); + } + // // Consolidation Cycle ... mConsolidationCycleHelper = new XC121SMCCycleHelper(); @@ -1093,8 +1195,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy // // Initial Cycle Provider ... cycleProvider.Init( + mTriggerCycleHelper, mDecisionCycleHelper, mAnalyseCycleHelper, + mVerificationCycleHelper, mConsolidationCycleHelper, mVisionCycleHelper // );