From cf11a36053e2835511782db53040cc594e722140 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 19 Sep 2024 05:36:31 +0330 Subject: [PATCH] last ... --- .../x-saherelm.x121.xtrade.handler.class.mq5 | 108 +++++++++++------- 1 file changed, 68 insertions(+), 40 deletions(-) diff --git a/Classes/x-saherelm.x121.xtrade.handler.class.mq5 b/Classes/x-saherelm.x121.xtrade.handler.class.mq5 index f4940de1..cc8d878e 100644 --- a/Classes/x-saherelm.x121.xtrade.handler.class.mq5 +++ b/Classes/x-saherelm.x121.xtrade.handler.class.mq5 @@ -2826,9 +2826,9 @@ class X121SCTradeHandler : public XSCBaseAlert ENUM_POSITION_TYPE type = NULL; ENUM_X_ORDER_MODES mode = X_ORDER_MODE_MARKET; double lastStep = mData[iDX].protectionStep; - double volume = lastStep <= 0 + double volume = supportsCount <= 0 ? position.volume * volumeMultiplier - : position.volume * ((lastStep + 1) * volumeMultiplier); + : position.volume * ((supportsCount + 1) * volumeMultiplier); // // Long Recovery ... @@ -2839,36 +2839,50 @@ class X121SCTradeHandler : public XSCBaseAlert canRecover = // isTicksBearishForShort && - hasBearishConditions + ( + // + hasBearishTrend && + (hasBearishPower || + hasBearishPattern || + hasBearishPressure) + // + ) // ; if (canRecover) { // - sl = position.entry; + sl = position.tp; tp = position.sl; type = POSITION_TYPE_SELL; } // // Same Direction ... - if (!canRecover) - { - // - canRecover = - // - isTicksBullishForLong && - hasBullishConditions - // - ; - if (canRecover) - { - // - sl = position.sl; - tp = position.entry; - type = POSITION_TYPE_BUY; - } - } + // if (!canRecover) + // { + // // + // canRecover = + // // + // isTicksBullishForLong && + // ( + // // + // hasBullishTrend && + // (hasBullishPower || + // hasBullishPattern || + // hasBullishPressure) + // // + // ) + // // + // ; + // if (canRecover) + // { + // // + // sl = position.sl; + // tp = position.entry; + // type = POSITION_TYPE_BUY; + // } + // } } // // Short Recovery ... @@ -2879,36 +2893,50 @@ class X121SCTradeHandler : public XSCBaseAlert canRecover = // isTicksBullishForLong && - hasBullishConditions + ( + // + hasBullishTrend && + (hasBullishPower || + hasBullishPattern || + hasBullishPressure) + // + ) // ; if (canRecover) { // - sl = position.entry; + sl = position.tp; tp = position.sl; type = POSITION_TYPE_BUY; } // // Same Direction ... - if (!canRecover) - { - // - canRecover = - // - isTicksBearishForShort && - hasBearishConditions - // - ; - if (canRecover) - { - // - sl = position.sl; - tp = position.entry; - type = POSITION_TYPE_SELL; - } - } + // if (!canRecover) + // { + // // + // canRecover = + // // + // isTicksBearishForShort && + // ( + // // + // hasBearishTrend && + // (hasBearishPower || + // hasBearishPattern || + // hasBearishPressure) + // // + // ) + // // + // ; + // if (canRecover) + // { + // // + // sl = position.sl; + // tp = position.entry; + // type = POSITION_TYPE_SELL; + // } + // } } //