How to find out if the market is closed? (mql4) - page 6

 
Alexey Busygin:
In some cases, the response has to come from the DC server! And the DCs don't really care about that. That's why it's not working so well.

Oh, good. That solved the problem.

:))))))))

 
Vasyl Nosal:

Oh, good. That solved the problem.

:))))))))

Yeah sure, why use something that doesn't work.
 
Vasyl Nosal:

And today

IsTradeAllowed(Symbol(), TimeCurrent())

shows cow.

The function seems to focus only on the trading schedule. And it cannot consider such exceptions as holidays because it requires additional schedule from the broker who does not consider it necessary.

As a result, we come to the conclusion that there is no simple way to determine a closed market. That leaves the method that has already been tested many times in practice.

By the way, why do you have Local Time?

Because the server time (TimeCurrent()) does not change on weekends.
 
Ihor Herasko:

...

Because the server time (TimeCurrent()) does not change on weekends.
Not true.
 
True, no change, last known server time or tick, no tick no time change.
 
Alexander Bereznyak:
Really, no change, last known server time or tick, no tick no time change.
Fuck..., is it hard for you to go to the terminal now and look???
 
Vasyl Nosal:
Fuck, is it hard for you to go to the terminal and look at it now???

Why would you do that? You can see for yourself that it does not change. Besides, there is a clear wording in the documentation:https://docs.mql4.com/ru/dateandtime/timecurrent.

Returns last known server time

That is, this is the time of the last incoming tick for any of the symbols from Market Watch. This time can change on weekends, if the broker provides quotes even on weekends and holidays. But the vast majority of brokers have no such thing - you will always get the time of the last tick on Friday at the weekend.

TimeCurrent - Документация на MQL4
  • docs.mql4.com
TimeCurrent - Документация на MQL4
 
Ihor Herasko:

Why would you do that? You can see for yourself that it does not change. Besides, there is a clear wording in the documentation:https://docs.mql4.com/ru/dateandtime/timecurrent.

That is, it is the time of the last incoming tick for any of the symbols in the Market Watch. On weekends, this time may change if the broker provides quote data even on weekends and public holidays.

Because if you go to the terminal at the weekend, the time is updated by the date you went in and it doesn't matter if there are ticks or not.
 
Vasyl Nosal:
Because if you enter the terminal, time is updated there by date when you entered the terminal and it does not matter whether there are ticks or not.

You dismiss the obvious without stating your facts. Where have you seen this? Perhaps in the terminals of brokers which give quotes at the weekend? Then that's right - there will be an update, but not when the terminal starts, but when the ticks come in.

Although, most likely, you mean some other time. For example, time in the journal. But this time cannot be obtained programmatically. And here we are referring exactly to TimeCurrent().

 
Vasyl Nosal:
Because if you go to the terminal at the weekend, the time is updated on the date when you logged in and it doesn't matter if there are ticks.

Demonstrate, please. And one more thing: "You're talking about TimeCurrent() - the last known server time, right?". And, by the way, judging by your logic, it is enough to disconnect from Internet (there will be no ticks - imitation weekend), wait 5 minutes, then go to terminal and time is updated in terminal?