iMA Error

 

Dear,

I am creating an EA in Meta Trader 5 and i am utilizing Moving Average but every time i call iMA() i am getting value is 10.0. can anyone help me to get rid of this error.

double ma20_value = iMA(Symbol(), PERIOD_CURRENT, 50, 0, MODE_SMA, PRICE_CLOSE);
 
Ali Sufian:

Dear,

I am creating an EA in Meta Trader 5 and i am utilizing Moving Average but every time i call iMA() i am getting value is 10.0. can anyone help me to get rid of this error.

Because that is the handle to work with the indicator not the indicator value
You need to read the documentation