From 57bb5900943c179de2c97b163f1af1438b53d79f Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 21 Mar 2025 07:59:34 +0330 Subject: [PATCH] last ... --- .../x-121.smc.market.cycle.helper.class.mq5 | 99 +++++++++++++++++++ .../Signals/x-121.smc.xwz.signal.lib.mq5 | 21 +++- 2 files changed, 118 insertions(+), 2 deletions(-) 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 9e008825..76c74674 100644 --- a/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 +++ b/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 @@ -2906,6 +2906,100 @@ struct X121SMCStrategyConditionParser bool hasSignalBox = iSignalBox.IsValid(); bool isSignalBoxBullish = IsBullish(iSignalBox.ob.dir); + // + // Check Consolidation Zone ... + XBoxZone cZone; + XBoxZone tmpBoxes[]; + if (isSignalBoxBullish) + { + // + ToBox( + cState.bullishConsolidationZones, + tmpBoxes // + ); + } + else + { + // + ToBox( + cState.bearishConsolidationZones, + tmpBoxes // + ); + } + has = HasChild(tmpBoxes); + if (has) + { + // + XBoxZone selectedBox; + if (iSignalBox.fvg.IsValid()) + { + selectedBox = iSignalBox.fvg; + } + else + { + selectedBox = iSignalBox.ob; + } + + // + idx = GetYoungest(tmpBoxes); + has = IsValidIndex(idx); + if (has) + { + // + cZone = tmpBoxes[idx]; + + // + // Check Consolidation Zone Place ... + has = + // + ( + // + IsBoxInsideOr( + cZone, + selectedBox // + ) + // + && + // + cZone.from >= selectedBox.from + // + ) + // + || + // + ( + // + IsBoxInsideOr( + selectedBox, + cZone // + ) + // + && + // + selectedBox.from >= cZone.from + // + ) + // + ; + if (!has) + { + cZone.Clean(); + } + } + + // + selectedBox.Clean(); + } + Clean(tmpBoxes); + + // + bool hasBullishCZone = cZone.IsValid() && + cZone.IsBullish(); + + // + bool hasBearishZone = cZone.IsValid() && + cZone.IsBearish(); + // // Bullish Conditions ... isBullish = @@ -2914,6 +3008,7 @@ struct X121SMCStrategyConditionParser ( // hasSignalBox && + hasBullishCZone && isSignalBoxBullish && isSignalBoxRetested && isBarValidForBullish @@ -2930,6 +3025,7 @@ struct X121SMCStrategyConditionParser ( // hasSignalBox && + hasBearishZone && !isSignalBoxBullish && isSignalBoxRetested && isBarValidForBearish @@ -3124,6 +3220,7 @@ struct X121SMCStrategyConditionParser zBar.Clean(); cBar.Clean(); pBar.Clean(); + cZone.Clean(); cState.Clean(); iSignalBox.Clean(); ZeroMemory(cHelper); @@ -4642,7 +4739,9 @@ struct X121SMCStrategyConditionParser cBar.Clean(); pBar.Clean(); pPBar.Clean(); + cZone.Clean(); cState.Clean(); + zoneBox.Clean(); iSignalBox.Clean(); ZeroMemory(cHelper); cConditions.Clean(); diff --git a/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 b/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 index 3c8557ce..c7b2c11f 100644 --- a/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xwz.signal.lib.mq5 @@ -1248,7 +1248,7 @@ struct X121SMCStrategyXWZWorkingZone // --------------------------------------------- // Rejected Box ... // --------------------------------------------- - bool useSenario1 = false; + bool useSenario1 = true; bool isSenario1Happend = false; bool isSenario1Bullish = false; bool isSenario1Bearish = false; @@ -1368,7 +1368,7 @@ struct X121SMCStrategyXWZWorkingZone // ----------------------------------------------- // Detect Signal Box Based On XHKMA Conditions ... // ----------------------------------------------- - bool useSenario4 = true; + bool useSenario4 = false; bool isSenario4Happend = false; bool isSenario4Bullish = false; bool isSenario4Bearish = false; @@ -1422,6 +1422,23 @@ struct X121SMCStrategyXWZWorkingZone { } + // + // Senario 6: + // --------------------------------------------- + // --------------------------------------------- + bool useSenario6 = false; + bool isSenario6Happend = false; + bool isSenario6Bullish = false; + bool isSenario6Bearish = false; + if (!isSenario1Happend && + !isSenario2Happend && + !isSenario3Happend && + !isSenario4Happend && + !isSenario5Happend && + useSenario6) + { + } + // // Summarize All Senario(s) Conditions ...