-
After Sleep and between server calls the market will have changed.
You must update your variables. To use any pre-defined variables and series
arrays you must call RefreshRates In your post You aren't using any of them.
RefreshRates - Timeseries and Indicators Access - MQL4 Reference -
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors
before accessing prices.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forumOn MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
Timeseries 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
-
After Sleep and between server calls the market will have changed.
You must update your variables. To use any pre-defined variables and series
arrays you must call RefreshRates In your post You aren't using any of them.
RefreshRates - Timeseries and Indicators Access - MQL4 Reference -
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors
before accessing prices.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forumOn MT5: Unless the chart is that specific pair/TF, you must Synchronize the terminal Data from the Server.
Timeseries 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.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello guys,
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!