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
I have a quick question regarding the way that new history data is processed by custom indicators, probbaly best expressed by example.
Lets assume I have a custom indicator and attach it to the EURUSD D1 chart.
Every time a new quote is available for EURUSD the custom indicator start() function is called. Close[0] refers to the last close on the D1 chart.
Should code in the custom indicator such as...
iClose(NULL, PERIOD_M1, 0);
iClose(NULL, PERIOD_M5, 0);
iClose(NULL, PERIOD_M15, 0);
iClose(NULL, PERIOD_M30, 0);
iClose(NULL, PERIOD_H4, 0);
iClose(NULL, PERIOD_W1, 0);
iClose(NULL, PERIOD_MN1, 0);
...also return the same value as Close[0]. Are the most recent bars of the other timeframes updated with the most recent close price?
The reason I ask is that I have found that sometimes the most recent close of the other timeframes does not match the most recent close on D1.
I can write a loop within my custom indiator to recheck the close prices of the other timeframes and they do "catch up" as it were.
Can anyone shed any light on this behaviour?
Regards,
Laurence.