Sorry English is not my native language, i try to explain what i want to say
I think that is the data in Period_H4 don't have been updated (BUT PERIOD_M15 have updated),
iMA(NULL,PERIOD_H4,13,8,MODE_EMA,PRICE_CLOSE,1) = > it should get the price of last candlestick (index 1) In fact, it get index 2 data if H4 period data array have been updatedRefreshRate() is not work for me
Remember, that there are 16 x M15 bars in a H4 bat, so even though the M15
bar has updated and closed, you will still be within the current H4 bar.
Only after 16 x M15 bars will the H4 bar close.
If you want the MA value for the current H4 bar, then you must use a shift of  and not  (which is the previously closed bar). Also, "RefreshRates()" has no effect on the "iMA()" function because it ALWAYS returns current data.
iMA( NULL, PERIOD_H4, 13, 8, MODE_EMA, PRICE_CLOSE, 0 )
To add comments, please log in or register