From 725b0a8575bd52678e4e86761dcfeab77e470951 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 21 Mar 2025 07:37:21 +0330 Subject: [PATCH] last ... --- .../x-121.smc.market.cycle.helper.class.mq5 | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) 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 8ea6cd62..9e008825 100644 --- a/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 +++ b/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 @@ -4468,6 +4468,85 @@ struct X121SMCStrategyConditionParser bool hasBearishZoneBox = zoneBox.IsValid() && zoneBox.IsBearish(); + // + // Detecting Consolidation Zone ... + XBoxZone cZone; + if (hasBullishTrend) + { + // + ToBox( + cState.bullishConsolidationZones, + tmpBoxes // + ); + } + else if (hasBearishTrend) + { + // + ToBox( + cState.bearishConsolidationZones, + tmpBoxes // + ); + } + has = HasChild(tmpBoxes); + if (has) + { + // + idx = GetYoungest(tmpBoxes); + has = IsValidIndex(idx); + if (has) + { + // + cZone = tmpBoxes[idx]; + + // + // Check Consolidation Zone Place ... + has = + // + ( + // + IsBoxInsideOr( + cZone, + zoneBox // + ) + // + && + // + cZone.from >= zoneBox.from + // + ) + // + || + // + ( + // + IsBoxInsideOr( + zoneBox, + cZone // + ) + // + && + // + zoneBox.from >= cZone.from + // + ) + // + ; + if (!has) + { + cZone.Clean(); + } + } + } + Clean(tmpBoxes); + + // + bool hasBullishCZone = cZone.IsValid() && + cZone.IsBullish(); + + // + bool hasBearishCZone = cZone.IsValid() && + cZone.IsBearish(); + // // Summarize Conditions ... @@ -4477,6 +4556,7 @@ struct X121SMCStrategyConditionParser // // Base Bullish Conditions ... hasBullishTrend && + hasBullishCZone && hasBullishZoneBox && hasBullishSignalBox && isBarValidForBullish && @@ -4492,6 +4572,7 @@ struct X121SMCStrategyConditionParser // // Base Bearish Conditions ... hasBearishTrend && + hasBearishCZone && hasBearishZoneBox && hasBearishSignalBox && isBarValidForBearish && @@ -4519,12 +4600,39 @@ struct X121SMCStrategyConditionParser // box.to = TimeCurrent(); + cZone.to = TimeCurrent(); // if (result) { + // + XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer; + + // + XCBoxObject *iObj; + has = drawer.DrawBox( + box, + iObj // + ); + + // + XCBoxObject *iCObject; + has = drawer.DrawBox( + cZone, + iCObject // + ); + if (has) + { + // + iCObject.BoxColor(clrLime); + iCObject.BoxStyle(STYLE_SOLID); + } + // Print("Found ..."); + + // + ZeroMemory(drawer); } }