Have you taken into account that a new bar will not appear on several symbols at the same time? It may well be that a new bar has already appeared on one symbol, but not on another.
No, the bars on each symbol will only form once there is a new tick after the start time of the bar. So it will vary from symbol to symbol.
You must code knowing this and check the data you are getting before you use it, and wait if required until you have the data you need available.
Yes, you are right: not having a finished candle on the first tick on other symbols from time to time was the problem. Now I'm waiting the ticks until all candles are available.
Thank you both!
Thank you both!

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
Hi,
I coded a small indicator that uses not only OHLC of the symbol where the indicator is placed, but it also uses OHLC from other symbols to generate signals.
At the very first tick of a new candle I try to get the OHLC from the symbols with CopyRates into a MqlRates struct.
The thing is:
If I insert the indicator for the first time on a chart everything is fine, signals are shown where they should (I draw arrows) but when the indicator is on a chart with ticking data it sometimes misses a signal. If I re-insert the indicator the missed signals appear like normal, so I think it is a timing problem that occurs when the market gets faster.
Are there known timing problems with CopyRates()? How can I avoid this?
Best regards, Alex