Any help with the follow issue would be appreciated:
It seems that the iMA() function call in MT4 returns different values than the the built-in Moving Average function in the terminal. The terminal values are shown in the picture, and the code follows. I'm having the same issues with iBands().
I accept that it could just be an issue with my code, staring me in the face and I just can't see it. Again any help is appreciated.
It seems that the iMA() function call in MT4 returns different values than the the built-in Moving Average function in the terminal. The terminal values are shown in the picture, and the code follows. I'm having the same issues with iBands().
I accept that it could just be an issue with my code, staring me in the face and I just can't see it. Again any help is appreciated.
Inserted Code
#property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Gray double SignalBuffer[]; int init() { SetIndexBuffer(0, SignalBuffer1); SetIndexStyle(0, DRAW_LINE, EMPTY, 3, Gray); SetIndexLabel(0, "Sig 1"); return(0); } int deinit() { return(0); } int start() { int i = Bars - IndicatorCounted(); while (i > 0) { SignalBuffer[i] = iMA(NULL, 0, 20, 0, MODE_SMA, MODE_CLOSE, i); i--; } }