Features of the mql5 language, subtleties and tricks - page 76

 
Vitaly Muzichenko:

Robo

My local was 17:17:13

It turns out that TimeTradeServer returns not what is stated in the documentation, but just the local time?
 
Vitaly Muzichenko:

And who is to blame for this, the terminal or the DC with crooked settings?

The terminal. This is reproduced on the MQ-Demo.

 
Alexey Viktorov:
It turns out that TimeTradeServer returns not what it says in the documentation, but just the local time?

It's because everything is connected to the local time.

But what does the word Server have to do with it?

Server, is the server, not the user's computer!

Anyway, not enough server time, without any binding to the computer, and lunar cycles. By TimeCurrent() alone, there is no way to know how much time has elapsed, from the last tick by server time, not computer time.

 
Alexey Viktorov:
It turns out that TimeTradeServer returns not what is stated in the documentation, but just the local time?

Yes.

 
Vitaly Muzichenko:

By TimeCurrent() alone, on weekends there is no way to know how much time has passed from the last tick to the time of the server, not the computer.

Use the MT4 variant, it also works on weekends.

 
fxsaber:

Use the MT4 option, it works on weekends too.

Thank you!

But still, in the new build you can add just one function, and not use self-written crutches in the code for the simplest calculation.

 
Vitaly Muzichenko:

Yes, the point is that everything is tied to the local time of the computer, the documentation says so

But what does the word Server have to do with it?

The server is the server, not the user's computer!

Anyway, not enough server time, without any binding to the computer, and lunar cycles. By TimeCurrent() alone, on weekends there is no way to find out how much time has passed since the last tick in the server time, not the computer.

Probably need to write an application to the CD. Or invite Renat here.

 
Vitaly Muzichenko:

Thank you!

But still in the new build you can add just one function, and not use for the simplest calculation self-written crutches in the code.

I thought you needed to solve the problem for practical use, not for "I wish..." talk.

 
fxsaber:
GMTOffset on forex symbols can be determined by the closing/opening time of the trading week. After all, the local time of this event is known.

How? It can change even within the account at different time zones of the local PC and the server.

 
fxsaber:

Thought you needed the problem solved for practical application, not for "I wish..." talk.

I need.

Only without assumptions that it is a full working week (without holidays, server pauses), that Monday's quote came in the first minute, or that the nonfarm went out on schedule (I saw this option, too). And without counting on the fact that the call will take place during working hours of the server.

Reason: