I am new to MT4 and I am trying to convert some code from ProRealTime to MT4
I get compile warning "possible loss of data due to type conversion". Can't seem to find how to correct the code.
// c1 =abs( high - low)
// c2 = abs( close-high )
// c3 = abs ( close - low )
double c3=MathAbs (Close-Low);
// c4 = max(c1,c2)
// c5 = max(c4,c3)
atr =iMA(NULL, 0, Nbr_Periods, 0, MODE_SMA, c5, 0);
Your iMA call is not correct, you misunderstood the parameter applied_price. You don't have to provide a price (double), you have to select which price will be used.
Forum on trading, automated trading systems and testing trading strategies
This forum is about MT5/mql5, please post your question about MT4/mql4 on mql4.com forum.