From 3cbedd591a02ee1d7520397180830baf29991323 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 1 Jul 2024 01:22:30 +0330 Subject: [PATCH] apply fix ... --- Classes/x-saherelm.x121.setup.xea.mq5 | 31 +++++++++++++++++++-------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Classes/x-saherelm.x121.setup.xea.mq5 b/Classes/x-saherelm.x121.setup.xea.mq5 index a07b9440..093d32ab 100644 --- a/Classes/x-saherelm.x121.setup.xea.mq5 +++ b/Classes/x-saherelm.x121.setup.xea.mq5 @@ -4532,10 +4532,13 @@ public: // // Check Signal Delay Passed ... - isSignalValid = IsSignalDelayPassed( - iSignal, - symbolPositions[symbolIDX] // - ); + isSignalValid = + !isValidSymbolIDX + ? true + : IsSignalDelayPassed( + iSignal, + symbolPositions[symbolIDX] // + ); if (!isSignalValid) { continue; @@ -4548,7 +4551,9 @@ public: // // Close Opposit Positions ... int oppositCount = - isLong + !isValidSymbolIDX + ? 0 + : isLong ? symbolPositions[symbolIDX].CountShorts() : symbolPositions[symbolIDX].CountLongs(); bool hasOpposit = IsValidSize(oppositCount); @@ -4597,7 +4602,9 @@ public: // // Close Opposit Supports ... int oppositSupportCount = - isLong + !isValidSymbolIDX + ? 0 + : isLong ? symbolPositions[symbolIDX].CountShortSupports() : symbolPositions[symbolIDX].CountLongSupports(); bool hasOppositSupport = IsValidSize(oppositSupportCount); @@ -4650,7 +4657,9 @@ public: { // int usedCount = - !perDirection + !isValidSymbolIDX + ? 0 + : !perDirection ? symbolPositions[symbolIDX].Count() : isLong ? symbolPositions[symbolIDX].CountLongs() @@ -4677,6 +4686,8 @@ public: isSignalValid = !hasSameTypeSignal ? true + : !isValidSymbolIDX + ? true : isLong ? symbolPositions[symbolIDX].longsProfit > 0 : symbolPositions[symbolIDX].shortsProfit > 0; @@ -4699,7 +4710,9 @@ public: { // double multiplier = - (isLong + (!isValidSymbolIDX + ? 0 + : isLong ? symbolPositions[symbolIDX].CountLongs() : symbolPositions[symbolIDX].CountShorts()) + 1; @@ -4722,7 +4735,7 @@ public: // } - + // result = ArraySize(eSignals);