Download MetaTrader 5

iMA sometimes Return "0". Someone coul'd help me?

To add comments, please log in or register
Alessandro
5
Alessandro  
Hello to all,
I have a problem with iMA function for calculating the moving average. The function almost always returns the correct value but in some cases of some currencies returns to ZERO.
I am making a simple calculation of the moving average of 200 periods
eg. SMA200 = iMA (Symbol iTFMinute, 200, MovingShift, MODE_SMA, PRICE_CLOSE, 0);
I also checked GetLastError () but returns "0".
In many cases, however, when it does not work MODE_SMA almost always works MODE_EMA, but i need SMA value :(
I do not understand why. You can help me?
Thank you so much ... I'm really going crazy
whroeder1
15574
whroeder1  
You don't have 200 bars in that TF.
To add comments, please log in or register