Synchronise Windows local time with the MT5 server - page 12

 

Guys from BCS, who have a real account,

please run the code on a real account and post the result here.

#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   MqlTick post_ticks[];
   string symbol = "Si-3.17";
   ulong from = ulong(D'2017.01.20 23:49:00') * 1000;
   int result=CopyTicks(symbol, post_ticks, COPY_TICKS_ALL, from, 2000);
   if(result > 0)
   {
     string str="";
     int f_handle=FileOpen("Si-3.17_ticks.txt",FILE_WRITE|FILE_ANSI|FILE_TXT);
     if (f_handle != INVALID_HANDLE)
     {
       FileWrite(f_handle, "Symbol\tTime\tLast\tFlags");
       for(int i = 0; i< result;i++)
       {
         if(post_ticks[i].flags == 88)
         {
         str=symbol + "\t" + string(post_ticks[i].time) + "." +
             string(post_ticks[i].time_msc%1000) + "\t" + string(post_ticks[i].last) +
             "\tПродажа";
         }
         else
         if(post_ticks[i].flags == 56)
         {
           str=symbol + "\t" + string(post_ticks[i].time) + "." +
             string(post_ticks[i].time_msc%1000) + "\t" + string(post_ticks[i].last) +
             "\tПокупка";
         }
         else
         {
           str=symbol + "\t" + string(post_ticks[i].time) + "." +
             string(post_ticks[i].time_msc%1000) + "\t" + string(post_ticks[i].last) +
             "\t" +  string(post_ticks[i].flags);
         }    
         FileWrite(f_handle, str);    
       }
       FileClose(f_handle);
     }
   }
//---
   return(INIT_SUCCEEDED);
  }
 
Synchronisation takes place on the first transaction (for now, pending clarification)
Files:
 
prostotrader:

It's unlikely to be resolved that quickly :(

Added

I think I have an idea why this is happening!

The thing is that deals and quotes (orders) from the exchange are coming in different streams,

and on the server they are processed by different functions. The one that is responsible for deals

works correctly and saves the information in the history

(as evidenced by the fact that we have not a single skip in 496,357 trades), and the one responsible for

responsible for orders is not so good...

Here is an excerpt from correspondence with the BOD:

Support Team 2016.12.14 14:17

1. Тики (а также буки, текущие цены из маркет вотча) обновляются/собираются независимо от работы индикаторов/экспертов. Также независимо от экспертов строятся бары.

2. А вот расчет индикаторов происходит в потоке построения баров. То есть после каждого применения тика к бару - вызывается расчет индикатора! При этом ни один тик не пропускается.

3. Отсюда получается, что вызывая из индикатора CopyTicks вы можете получать более свежие тиковые данные (а также буки, значения из маркет вотча), чем те, что уже применены к барам.

Это нужно учитывать в расчетах: либо вы анализируете тики, либо бары, либо если нужно и то и другое, то кому то нужно отдать приоритет (для случая последнего бара).

4. Особенно это начинается сильно проявляется если расчет индикатора делается долго.
 
Alexey Kozitsyn:

I will leave here for your reference an extract from the correspondence with the SR:

2. А вот расчет индикаторов происходит в потоке построения баров. То есть после каждого применения тика к бару - вызывается расчет индикатора! При этом ни один тик не пропускается.
You run a slow indicator on EURUSD M1. You run the EA on another EURUSD M1 chart. And if the EA uses bar history, you get constant crashes.
 
prostotrader:
Synchronisation happens on the first transaction (for now, pending clarification)

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 :)

Files:
 

From the announcement of the new build 1525 item 11

MQL5: Исправлена ошибка, в некоторых случаях приводившая к пропуску тиков в тиковой истории.


But the SD didn't write anything at all.

Were there any "holes" earlier?

 
prostotrader:

From the announcement of the new build 1525 item 11

MQL5: Исправлена ошибка, в некоторых случаях приводившая к пропуску тиков в тиковой истории.


But the SD didn't write anything at all.

Were there any "holes" earlier?

Earlier, there definitely were. In terms of TRADE ticks - for sure. In build 1495 it is much better.
 
Alexey Kozitsyn:
Earlier - they certainly were. In terms of TRADE ticks - for sure. In build 1495 it is much better.

I did not find any omissions on almost 500,000 trades.

Apparently they didn't fix anything else, apart from the INFOs (orders)...

But, it's good to see that the progxx is there after all.

Added

It is a pity that forum participants (FORTS) are weak in this important problem.

No one from BCS has ever posted a test.

The more data, the quicker they can correct it.

 
prostotrader:

I did not find any omissions on almost 500,000 trades.

Apparently they didn't fix anything else, apart from the INFOs (orders)...

But, it is good to see that the progrexs are there after all.

Yes, there is progress - great progress. But to do synchronization in real time (to reconcile ticks in a candle with volume that can be obtained from volume[]) - you have to put a lot of crutches. So far this question is not completely closed for me. SDs have stopped answering me :)
 
prostotrader:

I did not find any omissions on almost 500,000 trades.

Apparently they didn't fix anything else, apart from the INFOs (orders)...

But, it's good to see that the progxx is there after all.

Added

It is a pity that forum participants (FORTS) are weak in this important problem.

No one from BCS has ever posted a test.

The more data, the quicker they can correct it.

The history from BCS had more jambs than the same period in Otkritie. Haven't done the tests yet this year.
Reason: