I've a multi-currency EA that use the open of daily candle for some calclations. I've coded it as
Most of times the value obtained from iOpen is right, but sometimes occurs that value is wrong and it is taken from yesterday candle, like I was written iOpen(oSy,PERIOD_D1,1).
Have anyone had a problem like this?
Why it occurs?
Thanks to all!
On MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
and Indicators Access / Data Access - Reference on
algorithmic/automated trading language for MetaTrader 5
Synchronize Server Data
with Terminal Data - Symbols - General - MQL5 programming forum
You updated the predefined variables, then slept, so now they are out of sync. Moronic.
What part of #1 № 2 didn't you read?
Thanks for your kindness, man! Maybe you need to read again my message to understand that I refreshed variables after sleep command. The code is right, I mad a mistake in writing the phrase
Anyway, the problem is solved.