From 692c1b786c939d76f6c3e8e00c41a79ddf8c9700 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 27 Jan 2025 09:13:52 +0330 Subject: [PATCH] last ... --- .../Signals/x-121.smc.xhkpv.signal.lib.mq5 | 72 +++++++++++++++---- .../Strategy/x-121.smc.strategy.class.mq5 | 4 +- 2 files changed, 61 insertions(+), 15 deletions(-) diff --git a/X121SMCEA/Signals/x-121.smc.xhkpv.signal.lib.mq5 b/X121SMCEA/Signals/x-121.smc.xhkpv.signal.lib.mq5 index 0b815dda..a27f85ae 100644 --- a/X121SMCEA/Signals/x-121.smc.xhkpv.signal.lib.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xhkpv.signal.lib.mq5 @@ -55,6 +55,8 @@ struct X121SMCStrategyXHKPVSignalConditions double point; // + XBoxZone priceBox; + XCOrderBlock *priceOB; X121SMCCycleState state; // @@ -177,6 +179,8 @@ struct X121SMCStrategyXHKPVSignalConditions // state.Clean(); + priceOB = NULL; + priceBox.Clean(); } // @@ -687,27 +691,69 @@ bool DetectX121SMCXHKPVSignalSetup( // Detect Cycle State ... // + bool hasPriceBox = conditions.priceBox.IsValid(); bool hasState = visionCycleHelper.GetCycleState(conditions.state); // - XBoxZone priceBox; - bool hasPriceBox = false; - XCOrderBlock *priceOB = NULL; - if (hasState) + // Detect Price Box if not Provided ... + if (hasState && + !hasPriceBox) { // hasPriceBox = DetectPriceInsideBox( - priceBox, - priceOB, + conditions.priceBox, + conditions.priceOB, decisionXConditions, conditions.state // ); + } + + // + if (hasPriceBox) + { + // + // Update Price Box Date ... + conditions.priceOB.To(cTime); + conditions.priceBox.to = cTime; // - if (hasPriceBox) - { + // Here We Can Validate Box by Same Cycles Peaks and Vales ... + bool isBullish = IsBullish(conditions.priceBox.dir); + + // + int cIDX = 1; + + // + bool isSameCyclePeaks = // - // Here We Can Validate Box by Same Cycles Peaks and Vales ... + triggerXConditions.peaksBuffer[cIDX] == decisionXConditions.peaksBuffer[cIDX] && + decisionXConditions.peaksBuffer[cIDX] == analyseXConditions.peaksBuffer[cIDX] && + analyseXConditions.peaksBuffer[cIDX] == verificationXConditions.peaksBuffer[cIDX] + // + ; + + // + bool isSameCycleVales = + // + triggerXConditions.valesBuffer[cIDX] == decisionXConditions.valesBuffer[cIDX] && + decisionXConditions.valesBuffer[cIDX] == analyseXConditions.valesBuffer[cIDX] && + analyseXConditions.valesBuffer[cIDX] == verificationXConditions.valesBuffer[cIDX] + // + ; + + // + // Check Validation Conditions ... + bool isPriceOBValid = + // + hasPriceBox && + (isBullish + ? isSameCycleVales + : isSameCyclePeaks) + // + ; + if (isPriceOBValid) + { + Print("Valid Conditions ..."); } } @@ -723,13 +769,13 @@ bool DetectX121SMCXHKPVSignalSetup( if (hasPriceBox) { // - bool isBullish = IsBullish(priceBox.dir); + bool isBullish = IsBullish(conditions.priceBox.dir); color boxColor = isBullish ? clrYellow : clrOrange; // XCBoxObject *iObj; bool isCreated = visionCycleHelper.mPOIDrawer.CreateBox( - priceBox, + conditions.priceBox, iObj, boxColor, 1, @@ -756,7 +802,7 @@ bool DetectX121SMCXHKPVSignalSetup( isCreated = visionCycleHelper .mPOIDrawer .CreateBullishOrderBlock( - priceOB, + conditions.priceOB, iObj // ); @@ -779,7 +825,7 @@ bool DetectX121SMCXHKPVSignalSetup( isCreated = visionCycleHelper .mPOIDrawer .CreateBearishOrderBlock( - priceOB, + conditions.priceOB, iObj // ); diff --git a/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 b/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 index 6ab96508..752690aa 100644 --- a/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 +++ b/X121SMCEA/Strategy/x-121.smc.strategy.class.mq5 @@ -1231,8 +1231,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy x121Inputs.xhkInputs.xhkIgnoreSmoothingShadows = true; // - x121Inputs.xhkInputs.drawRawXHKCandles = showAll || true; - x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true; + x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false; + x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false; // // XATR ...