Array out of Range Error while using [i+2] in getting Moving Average value in MQL5 - page 2

To add comments, please log in or register
ffoorr
1218
ffoorr  

because

ma[i+2]  = ma[(prev_calculated-1) + 2 ] =  ma[prev_calculated+1] ;

which do not exist

Your indicator should not be as series

 ArraySetAsSeries(MA,true);
 ArraySetAsSeries(MA2,true);
 ArraySetAsSeries(MA3,true);

12
To add comments, please log in or register