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 [0] and not [1] (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 )

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Sorry English is not my native language, i try to explain what i want to say
as title,
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 updated
RefreshRate() is not work for me
Any ideas are appreciated : )