Synchronise Windows local time with the MT5 server - page 4

 
Sergey Chalyshev:

OnBookEvent() will be triggered, but the time of tick change is not fixed anywhere.

Only tick arrival time is fixed, i.e. change of bid, last, ask.

Thus, the market rate has changed, but the time of the last tick arriving is old.

No, not the old one, because I try to take the new server's time with TimeCurrent()

datetime cur_time=TimeCurrent(sv_time);
OnBookEvent() serves only as an abstract event
 
prostotrader:

No, not the old one, because I'm trying to get the new server time with TimeCurrent()

datetime cur_time=TimeCurrent(sv_time);
OnBookEvent() only serves as an abstract event

TimeCurrent is the time of the last tick, might even show yesterday,

at the weekend it shows Friday's closing time.

 
Sergey Chalyshev:

TimeCurrent is the time of the last tick, it may even show yesterday,

on weekends, it shows Friday's closing time.

Look at the code carefully
 

Was looking for something similar on the forum and came across this (2014)

https://www.mql5.com/ru/forum/36995

 
prostotrader:

The previous crutch was much sleeker (by design), but,

I'll try this one.

This crutch doesn't sync correctly either :(
 
The correct solution is to find out the location of the DC server and synchronise with its geography. (set its time zone in the ntp settings.) Otherwise, a second instance of the "tick/cup synchronizer" will drive the time service crazy, and it will go crazy with just one
 
Maxim Kuznetsov:
the correct solution is to find out the location of the DC server and synchronise by its geography. (set its time zone in ntp settings.) Otherwise, a second instance of "tick/cup synchronizer" will drive the time service crazy, it will go crazy even with one

No, it's not!

Anything OTHER than MT5 server time is NOT RIGHT, as we trade through the MT5 SERVER!!!!

Added

I would VERY much hope that the MT5 server time itself is SYNCHRONIZED correctly with the time of the Bourse!

 
prostotrader:

No, it's not!

Anything OTHER than MT5 server time is NOT RIGHT, as we trade through the MT5 SERVER!!!!

Added

I VERY much hope that the MT5 server time itself is SYNCHRONIZED correctly with the time of the Bourse!

In theory, it should be in the technical requirements for connecting to the exchange, that the server time to connect is not rushed and is not lagging, and differs from the exchange in corot.s with the time zone. There also work in real time - ntp as mandatory, otherwise hard to solve problems in operation and protection.
 
Maxim Kuznetsov:
In idea it should be in the technical requirements for connection to the exchange, that the time of the connecting server is not rushed and not lagging, and differs from the exchange in accordance with the time zone. There's also real-time operation - ntp as mandatory, otherwise intractable problems in operation and protection.
Ideally, there should be no time synchronisation issues in an exchange platform.
 
prostotrader:
This crutch doesn't sync correctly either :(

I warned you:

Forum on trading, automated trading systems and trading strategy testing

Synchronizing Windows local time with MT5 server

Sergey Chalyshev, 2017.01.18 19:23

COnBookEvent will not work, you need to synchronize in OnTick.

You get to use the tick time and take the data at the time of change of the cup,

timeOnBookEvent!=OnTick