Open m4ddav3 opened 3 years ago
Added #2 to resolve this
@m4ddav3 Thank you so much for contributing! I would like to take just a few minutes to reproduce the error and the fix, could you give me a quick explanation on how to trigger the error (is it possible to get this purely programmatically or does it also show up when using the indicator in the charts?)?
The solution is pretty simple:
//--- calculate MACD
if(ArraySize(ExtMacdBuffer)>=rates_total-1)
if(ArraySize(ExtFastMaBuffer)>=rates_total-1)
if(ArraySize(ExtSlowMaBuffer)>=rates_total-1)
for (int i = limit; i < rates_total && !IsStopped(); i++)
@m4ddav3 Thank you so much for contributing! I would like to take just a few minutes to reproduce the error and the fix, could you give me a quick explanation on how to trigger the error (is it possible to get this purely programmatically or does it also show up when using the indicator in the charts?)?
right click -> refresh
then the indicator shows no values
Hi! Love the indicator, however when I tried to incorporate it into an EA, it failed to calculate properly.
2020.11.13 23:37:04.748 2017.01.02 00:01:30 array out of range in 'MACDClassic.mq5' (158,64)
The offending line is:
ExtMacdBuffer[i] = ExtFastMaBuffer[i] - ExtSlowMaBuffer[i];
It fails on ExtSlowMaBuffer[i] almost immediately, then the indicator shows no values