My EA is sensitive to the information of some recent candlesticks of M1 timeframe. If the internet connection stops for a few minutes, how do I make sure that the functions used (iTime, CopyClose ,...) give the correct values?
How can I know that the output values of these functions are correct after reconnecting?
I think TimeCurrent() return last tick time but iTime() return open time of candle. Is their comparison correct? They are two different things.
In the usual case, they are only equal when new bar is happen.
I never said they should be equal. I thought the solution was obvious so I didn't explain, let's do it :
When your code run, you have a current time, if you request OHLC data you just have to check if the current time is inside the bar 0 (using iTime or
CopyTime), if not, that means the data you got (using CopyClose or whatever) are not updated yet. If you get old data, bar 0 will be in the past
not current open candle.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
My EA is sensitive to the information of some recent candlesticks of M1 timeframe. If the internet connection stops for a few minutes, how do I make sure that the functions used (iTime, CopyClose ,...) give the correct values?
How can I know that the output values of these functions are correct after reconnecting?