diff --git a/Helpers/x-saherelm.x121.helper.mq5 b/Helpers/x-saherelm.x121.helper.mq5 index 31b50d39..85624ce8 100644 --- a/Helpers/x-saherelm.x121.helper.mq5 +++ b/Helpers/x-saherelm.x121.helper.mq5 @@ -267,15 +267,6 @@ struct X121Conditions // // Conditions ... - // - // XTrend ... - - // - bool isTrendBullish; - bool isTrendBearish; - bool isTrendSwitchedToBullish; - bool isTrendSwitchedToBearish; - // bool isRsiSlopeBullish; bool isStrSlopeBullish; @@ -1067,29 +1058,6 @@ struct X121Conditions bearishScore += highScore; } - // - // XTREND ... - - // - if (isTrendBullish) - { - bullishScore += minScore; - } - if (isTrendSwitchedToBullish) - { - bullishScore += score; - } - - // - if (isTrendBearish) - { - bearishScore += minScore; - } - if (isTrendSwitchedToBearish) - { - bearishScore += score; - } - // // XSAR ... @@ -1796,14 +1764,6 @@ struct X121Conditions ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) + // "-----------------------" + separator + - "Trend ..." + separator + - "-----------------------" + separator + - ToString("isTrendBullish", isTrendBullish, ignoreFalseConditions, separator) + - ToString("isTrendBearish", isTrendBearish, ignoreFalseConditions, separator) + - ToString("isTrendSwitchedToBullish", isTrendSwitchedToBullish, ignoreFalseConditions, separator) + - ToString("isTrendSwitchedToBearish", isTrendSwitchedToBearish, ignoreFalseConditions, separator) + - // - "-----------------------" + separator + "STR ..." + separator + "-----------------------" + separator + ToString("isStrBullish", isStrBullish, ignoreFalseConditions, separator) + diff --git a/Libraries/x-saherelm.x-poi.state.lib.mq5 b/Libraries/x-saherelm.x-poi.state.lib.mq5 index 681afe7b..2641a4a3 100644 --- a/Libraries/x-saherelm.x-poi.state.lib.mq5 +++ b/Libraries/x-saherelm.x-poi.state.lib.mq5 @@ -53,6 +53,10 @@ struct XSignalBox XBoxZone fvg; XBoxZone sharp; + // + double sl; + double tp; + // // Constructor ... XSignalBox() @@ -68,6 +72,10 @@ struct XSignalBox */ void Clean() { + // + sl = 0; + tp = 0; + // ob.Clean(); fvg.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 c489dfa8..c9716307 100644 --- a/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 +++ b/X121SMCEA/Classes/x-121.smc.market.cycle.helper.class.mq5 @@ -3112,6 +3112,35 @@ struct X121SMCStrategyConditionParser // // Checking Other Conditions ... + // + // XVWAP ... + + // + bool isVWapSlopeBullish = + cXConditions.isVwapFastSlopeBullish && + cXConditions.isVwapMidSlopeBullish && + cXConditions.isVwapSlowSlopeBullish; + + // + bool isVWapSlopeBearish = + cXConditions.isVwapFastSlopeBearish && + cXConditions.isVwapMidSlopeBearish && + cXConditions.isVwapSlowSlopeBearish; + + // + bool isVWapBullishCondition = + (cXConditions.isVWapBullishOrdered && + cXConditions.isVWapSwitchedToBullishState) || + (cXConditions.isVWapBullishState && + cXConditions.isVWapSwitchedToBullishOrdered); + + // + bool isVWapBearishCondition = + (cXConditions.isVWapBearishOrdered && + cXConditions.isVWapSwitchedToBearishState) || + (cXConditions.isVWapBearishState && + cXConditions.isVWapSwitchedToBearishOrdered); + // // Bullish Conditions ... isBullish = @@ -3121,7 +3150,9 @@ struct X121SMCStrategyConditionParser // hasSignalBox && isSignalBoxBullish && - isBarValidForBullish + isVWapSlopeBullish && + isBarValidForBullish && + isVWapBullishCondition // ) // @@ -3135,8 +3166,10 @@ struct X121SMCStrategyConditionParser ( // hasSignalBox && + isVWapSlopeBearish && !isSignalBoxBullish && - isBarValidForBearish + isBarValidForBearish && + isVWapBearishCondition // ) // @@ -3158,6 +3191,19 @@ struct X121SMCStrategyConditionParser // box = iSignalBox; box.UpdateTo(TimeCurrent()); + + // + // Provide TP/SL ... + + // + box.sl = isBullish + ? cXConditions.vwapMin + : cXConditions.vwapMax; + + // + box.tp = isBullish + ? box.sharp.upper + : box.sharp.lower; } // diff --git a/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 b/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 index 2f6b4edf..583c7fe5 100644 --- a/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 +++ b/X121SMCEA/Signals/x-121.smc.xwz.signal.class.mq5 @@ -485,7 +485,7 @@ class XCX121SMCXWZSignalDetector : public XCBase // // Prepare Box fro SL ... - iSL = pivot; + iSL = signalBox.sl; Add( iSL, sls // @@ -493,7 +493,7 @@ class XCX121SMCXWZSignalDetector : public XCBase // // Fix rf Reward ... - rfRewar = 2; + rfRewar = 1.5; } else if (signalProvider == X121SMC_XWZ_PROVIDER_XBREAKED_BOX) {