I think we should change the trading time check like this:
Read the TimeCurrent help - it says that this is the SERVER time
If there are no ticks, weekends or non-trading time, TimeCurrent does not change.
AndTimeTradeServerdoes not work, it shows the local time on your computer.
It's easy to check this by running the Expert Advisor:
When computer time changesTimeTradeServer also changes and shows computer timeTimeLocal.
If there are no ticks, weekends or non-trading times, TimeCurrent does not change.
AndTimeTradeServerdoes not work, it shows local computer time.
It is easy to check this by running the EA:
What prevents you from checking the computer time via TimeTradeServer first, and then (if the time is correct) use
function I wrote above to more accurately check the time?
Although, of course, this is not the solution, because there may be no quotes for this symbol :(
A bit of a head-scratcher and wrote this option, who thinks about this implementation .
You guys are the developers!
When are you going to synchronise the terminal time with the Exchange time?
A little more tinkering with the code has resulted in this.
The solutions are not from the programmers, but from the developers (or broker, if they, the broker, are responsible for it)
The code you cited does not check the current time of the Exchange.
So far, settled on this solution
First I takeTimeTradeServer - I get the current "dirty" time
I check for a weekend and a time (trading) that "overlaps" all sessions,
and then usingTimeCurrent
Current server time, to check the time within sessions.
But this check has one major drawback.
If the local computer time is more than the server time, it will be fine, but
But if the local time is less, then we have a big problem.
If we miss the start of bidding for the difference between the trading server time and local time :(
That's why we needTimeCurrent
always return the server time, not only the time of the last known quote.
The quotes are not coming to clearing, so usingTimeCurrent in clearing (e.g. for withdrawing pending orders) is senseless :(
Please enable the necessary setting in your browser, otherwise you will not be able to log in.