diff --git a/Classes/Indicators/x-saherelm.mid.class.mq5 b/Classes/Indicators/x-saherelm.mid.class.mq5 index e2eef797..ea8a5d05 100644 --- a/Classes/Indicators/x-saherelm.mid.class.mq5 +++ b/Classes/Indicators/x-saherelm.mid.class.mq5 @@ -304,12 +304,16 @@ public: } else { - start = prevCalculated - 1; + return; } + // else + // { + // start = prevCalculated - 1; + // } // // Loop through Bars ... - for (int i = start; i < totalBars - 1 && !IsStopped(); i++) + for (int i = totalBars - 1; i >= start && !IsStopped(); i--) { // XOHCL iBar; diff --git a/Indicators/x-saherelm.xmidtest.mq5 b/Indicators/x-saherelm.xmidtest.mq5 index bce0e1d1..40d701f4 100644 --- a/Indicators/x-saherelm.xmidtest.mq5 +++ b/Indicators/x-saherelm.xmidtest.mq5 @@ -120,14 +120,13 @@ int OnCalculate( // // - Print("Limit: ", limit, "last "); + Print("Limit: ", limit); + mMid.Calculate(); // // int midMainBufferCopied = mMid.CopyBuffer( // "XSCMid", - // mainBuffer, - // 0, - // rates_total // + // mainBuffer // ); // if (!IsValidSize(midMainBufferCopied)) // {