i am new to meta trader 4 and i am trying to obtain some indicator data from the moving average function.
But i don't get some basic things. If i use the M30 Period averaging over two periods shouldn't it be the H1 result for one period?
here is my example code:
Print(" M30*2 = "+iMA("EURUSD", PERIOD_M30, 2, 0, MODE_EMA, 0, 20)+" H1 = "+iMA("EURUSD", PERIOD_H1, 1, 0, MODE_EMA, 0, 10));
The other question is, if i use the shift argument in the right way to read the same time period for both indicator results.
My answer for the example is "File write EURUSD,M1: M30*2 = 1.106739999999999 H1 = 1.10631".
How the iMA indicator react when i ask him to give me history data in the following format?
inputVector = (10*ep)*(iMA("EURUSD", PERIOD_M1, 60, 0, 0, 0, shift_min+181));
where in a loop "shift_min" goes up to 720 (around one day).
Thank you for every usable advice
At the top of the hour, m30Close == H1Close therefor for the SMA (M30close + m30close)/2 will never be equal to the m30Close/1 == H1Close/1
The EMA includes all other candles (to some extent) thefor they will never be the same.
To add comments, please log in or register