Synchronise Windows local time with the MT5 server - page 14

 
Alexey Kozitsyn:
Please send here the instructions on how to open a real account at BCS.
To avoid searching every time, I put it in my profile.
 
fxsaber:
To avoid having to dig around every time, I've put it on my profile.
Thank you.
 

Alexey Kozitsyn:
Спасиб

Thanks, I've already done it myself.
Files:
 

I'm making a match, there are differences, but not significant.

In my opinion, the function of recording order ticks in the history is not working correctly (all is OK with trades).

I will make 300 lines and post the comparison file.

Added

Check it, i might have made a mistake

Files:
Book2.zip  671 kb
 
prostotrader:

Worked accurately at both 10:00 and 14:05

2017.01.26 10:00:00.000 Time_sync_forts (URKA-3.17,H1)  Local time sync is done. Symbol = RTS-3.17 Sync hour = 10 Sync min = 0 Sync sec = 0 Sync ms = 0
2017.01.26 14:05:00.005 Time_sync_forts (URKA-3.17,H1)  Local time sync is done. Symbol = RTS-3.17 Sync hour = 14 Sync min = 5 Sync sec = 0 Sync ms = 5

Added

I think I'll remove BR so that everything happens automatically for 3 months :)

And any idea how to "screw" evening clearing, given that the auction can start at 19-00, then 19-05?
 

So that's it.

And the morning session and after both clears.

Files:
 

A lot of painstaking work has been done. Since the time synchronization using the suggested method is based on taking into account the ping value, I have a question.

By requesting the TERMINAL_PING_LAST identifier, the terminal gives (according to the MQL documentation) the"Last known value of the ping to the trade server in microseconds".

What is it, is its value stable and how big is it? For many years I have seen this characteristic in log files, but now I can see pings in the list of servers directly in the terminal. And they are very stable. What is it?

Only two variants that I can imagine.

1) It is a network characteristic that routers use for analyzing IP packet paths, which is obtained using ICMP network protocol and actually only takes into account hardware signal propagation. In the particular case of ping measurements between a client computer and a server, it means back and forth between their NICs. Packets with this protocol usually do not reach the applications, it is not necessary https://ru.wikipedia.org/wiki/ICMP.

2. it doubles the signal travel time from the application on the server to the application at the client.

Anyone have a clue?

ICMP — Википедия
  • ru.wikipedia.org
ICMP Название: Уровень (по модели OSI): Семейство: Спецификация: ICMP (англ.   — протокол межсетевых управляющих сообщений[1]) — сетевой протокол, входящий в стек протоколов TCP/IP. В основном ICMP используется для передачи сообщений об ошибках и других исключительных ситуациях, возникших при передаче данных, например, запрашиваемая услуга...
 
Vladimir:

A lot of painstaking work has been done. Since the time synchronization using the suggested method is based on taking into account the ping value, I have a question.

By requesting the TERMINAL_PING_LAST identifier, the terminal gives (according to the MQL documentation) the"Last known value of the ping to the trade server in microseconds".

What is it, is its value stable and how big is it? For many years I have seen this characteristic in log files, but now I can see pings in the list of servers directly in the terminal. And they are very stable. What is it?

Only two variants that I can imagine.

1) It is a network characteristic used by routers for analyzing IP packet paths, which is obtained using ICMP network protocol and actually only takes into account hardware signal propagation. In the particular case of ping measurements between a client computer and a server, it means back and forth between their NICs. Packets with this protocol usually do not reach the applications, it is not necessary https://ru.wikipedia.org/wiki/ICMP.

2. it doubles the signal travel time from the application on the server to the application at the client.

Anyone have a clue?

Only the developers can answer this question for sure.

I was basing it on the second one.

>This is double the signal travel time from the application on the server to the application on the client.

 
prostotrader:

So that's it.

And the morning session and after both clears.

Everything works "like clockwork" :)

2017.01.30 10:00:00.000 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 10 Sync min = 0 Sync sec = 0 Sync ms = 0
2017.01.30 14:05:00.002 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 14 Sync min = 5 Sync sec = 0 Sync ms = 2
2017.01.30 19:00:00.003 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 19 Sync min = 0 Sync sec = 0 Sync ms = 3

Added

Just waiting for the bidding to start at 19-05

Market closed
Market closed
  • www.mql5.com
Ребята разработчики! Ну когда же Вы синхронизируете время терминала с временем Биржи...
 
prostotrader:

Everything works "like clockwork" :)

2017.01.30 10:00:00.000 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 10 Sync min = 0 Sync sec = 0 Sync ms = 0
2017.01.30 14:05:00.002 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 14 Sync min = 5 Sync sec = 0 Sync ms = 2
2017.01.30 19:00:00.003 Time_symc_forts (URKA-3.17,H1)  Local time sync is done. Symbol = Si-3.17 Sync hour = 19 Sync min = 0 Sync sec = 0 Sync ms = 3

Added

Just waiting for the bidding to start at 19-05

Added

For Sergey

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

Just for fun, turn it on if you don't mind, let's see how accurately the time is synchronised:

//+------------------------------------------------------------------+
//|                                            Delta Time Server.mq5 |
//+------------------------------------------------------------------+
struct _SYSTEMTIME
  {
   short             year;
   short             mon;
   short             day_of_week;
   short             day;
   short             hour;
   short             min;
   short             sec;
   short             msc;
  };

_SYSTEMTIME loc_time;

#import "kernel32.dll"
void GetLocalTime(_SYSTEMTIME &sys_time);
bool SetLocalTime(_SYSTEMTIME &sys_time);
#import
//---
MqlTick tick;
MqlDateTime sv_time;
int tick_msc,ping,time_server,time_local,delta=0,mdelta[10],n=0;
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   loc_time.year=0;
   GetLocalTime(loc_time);
   if(loc_time.year>0)
     {
      if(!SymbolInfoTick(_Symbol,tick)) { Print("error SymbolInfoTick: ",GetLastError()); return; }
      ping=TerminalInfoInteger(TERMINAL_PING_LAST)/1000;
      tick_msc=int(tick.time_msc%1000);
      TimeToStruct(tick.time,sv_time);

      time_server=(sv_time.sec+sv_time.min*60)*1000+tick_msc;
      time_local=(loc_time.sec+loc_time.min*60)*1000+loc_time.msc;

      delta=AvgDelta(time_server-time_local);
      
     Print(
           "ping : ",ping,
           " | time server: ",sv_time.hour,":",sv_time.min,":",sv_time.sec,",",tick_msc,
           " | time local: ",loc_time.hour,":",loc_time.min,":",loc_time.sec,",",loc_time.msc,
           " | delta ms: ",delta,
           " | min max delta: ",mdelta[ArrayMaximum(mdelta)]," : ",mdelta[ArrayMinimum(mdelta)],
           "");
     }
  }
//+------------------------------------------------------------------+
int AvgDelta(int d)
  {
   int avgd=0;
   mdelta[n]=d;
   n++; if(n>=10) n=0;
   for(int i=0;i<10;i++) avgd+=mdelta[i];
   return(avgd/10);
  }
//+------------------------------------------------------------------+

Reason: