From 96c154701c4516944c1c17c8f9e57f338af0c5cd Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 23 Jun 2024 08:29:09 +0330 Subject: [PATCH] last ... --- Classes/x-saherelm.x121.setup.xea.mq5 | 180 ++++++++++++++------------ Indicators/x-saherelm.xsln.mq5 | 3 + 2 files changed, 98 insertions(+), 85 deletions(-) diff --git a/Classes/x-saherelm.x121.setup.xea.mq5 b/Classes/x-saherelm.x121.setup.xea.mq5 index 53dc2757..0b24399d 100644 --- a/Classes/x-saherelm.x121.setup.xea.mq5 +++ b/Classes/x-saherelm.x121.setup.xea.mq5 @@ -2409,6 +2409,7 @@ protected: // // TODO: Complete this Later ... return result; + // // Validate Setups Count ... // int setupsCount = ArraySize(setups); @@ -3529,23 +3530,24 @@ public: cConditions.Clean(); // - cHasSignal = mSetups[i].ProcessMarket( - cSignal, - cConditions, - cPusher, - cProvider, - X_MARKET_CYCLE_UNKNOWN, - allowSupport, - allowLong, - allowShort, - volume, - slPoint, - ignoreSL, - tpPoint, - ignoreTP, - 0, - 5 // - ); + cHasSignal = mSetups[i] + .ProcessMarket( + cSignal, + cConditions, + cPusher, + cProvider, + X_MARKET_CYCLE_UNKNOWN, + allowSupport, + allowLong, + allowShort, + volume, + slPoint, + ignoreSL, + tpPoint, + ignoreTP, + 0, + 5 // + ); // // Short Market ... @@ -3558,23 +3560,24 @@ public: sConditions.Clean(); // - sHasSignal = mSetups[i].ProcessMarket( - sSignal, - sConditions, - sPusher, - sProvider, - X_MARKET_CYCLE_SHORT, - allowSupport, - allowLong, - allowShort, - volume, - slPoint, - ignoreSL, - tpPoint, - ignoreTP, - 0, - 5 // - ); + sHasSignal = mSetups[i] + .ProcessMarket( + sSignal, + sConditions, + sPusher, + sProvider, + X_MARKET_CYCLE_SHORT, + allowSupport, + allowLong, + allowShort, + volume, + slPoint, + ignoreSL, + tpPoint, + ignoreTP, + 0, + 5 // + ); // // Medium Market ... @@ -3587,23 +3590,24 @@ public: mConditions.Clean(); // - mHasSignal = mSetups[i].ProcessMarket( - mSignal, - mConditions, - mPusher, - mProvider, - X_MARKET_CYCLE_MEDIUM, - allowSupport, - allowLong, - allowShort, - volume, - slPoint, - ignoreSL, - tpPoint, - ignoreTP, - 0, - 5 // - ); + mHasSignal = mSetups[i] + .ProcessMarket( + mSignal, + mConditions, + mPusher, + mProvider, + X_MARKET_CYCLE_MEDIUM, + allowSupport, + allowLong, + allowShort, + volume, + slPoint, + ignoreSL, + tpPoint, + ignoreTP, + 0, + 5 // + ); // // Long Market ... @@ -3616,23 +3620,24 @@ public: lConditions.Clean(); // - lHasSignal = mSetups[i].ProcessMarket( - lSignal, - lConditions, - lPusher, - lProvider, - X_MARKET_CYCLE_LONG, - allowSupport, - allowLong, - allowShort, - volume, - slPoint, - ignoreSL, - tpPoint, - ignoreTP, - 0, - 5 // - ); + lHasSignal = mSetups[i] + .ProcessMarket( + lSignal, + lConditions, + lPusher, + lProvider, + X_MARKET_CYCLE_LONG, + allowSupport, + allowLong, + allowShort, + volume, + slPoint, + ignoreSL, + tpPoint, + ignoreTP, + 0, + 5 // + ); // // Hind Market ... @@ -3645,23 +3650,24 @@ public: hConditions.Clean(); // - hHasSignal = mSetups[i].ProcessMarket( - hSignal, - hConditions, - hPusher, - hProvider, - X_MARKET_CYCLE_HIND, - allowSupport, - allowLong, - allowShort, - volume, - slPoint, - ignoreSL, - tpPoint, - ignoreTP, - 0, - 5 // - ); + hHasSignal = mSetups[i] + .ProcessMarket( + hSignal, + hConditions, + hPusher, + hProvider, + X_MARKET_CYCLE_HIND, + allowSupport, + allowLong, + allowShort, + volume, + slPoint, + ignoreSL, + tpPoint, + ignoreTP, + 0, + 5 // + ); // // Parse Signals and Add them for Executing ... @@ -3676,6 +3682,7 @@ public: { // Print("Current Market Has Signal ..."); + Print(ToString(mSetups[i].cCycle.cycle.period)); } // @@ -3683,6 +3690,7 @@ public: { // Print("Short Market Has Signal ..."); + Print(ToString(mSetups[i].sCycle.cycle.period)); } // @@ -3690,6 +3698,7 @@ public: { // Print("Medium Market Has Signal ..."); + Print(ToString(mSetups[i].mCycle.cycle.period)); } // @@ -3705,6 +3714,7 @@ public: { // Print("Hind Market Has Signal ..."); + Print(ToString(mSetups[i].hCycle.cycle.period)); } // diff --git a/Indicators/x-saherelm.xsln.mq5 b/Indicators/x-saherelm.xsln.mq5 index 0bdf5370..68a5e2e5 100644 --- a/Indicators/x-saherelm.xsln.mq5 +++ b/Indicators/x-saherelm.xsln.mq5 @@ -138,7 +138,9 @@ int OnCalculate( // if (ArrayRange(work, 0) != rates_total) { + // ArrayResize(work, rates_total); + ArrayResize(stateBuffer, rates_total); } // @@ -153,6 +155,7 @@ int OnCalculate( work[i][lHi] = high[i]; work[i][lLo] = low[i]; work[i][trend] = -1; + stateBuffer[i] = -1; continue; }