MT5 and speed in action - page 8

 
A lot of checks put in... Surprised by this.
2020.06.03 14:09:21.604 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 182 ms.

No transactions were made at this point.


ZS It's not uncommon.

2020.06.03 14:31:39.484 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 65 ms.
 
fxsaber:

PS In combat mode, when transactions are made, there are almost always lags (I only output cases greater than 5 milliseconds).

Otherwise seems to be much better than 2470.

Stats accumulated. HistorySelect lags only when making transactions.


ZS Lies. Without transactions, too, there are lags.

2020.06.03 14:35:26.999 Alert: Time[NewTicks.mqh 112: ::HistorySelect(TimeMsc/1000,INT_MAX)] = 24 ms.
 
fxsaber:
Put a lot of checks on it... Surprised by this.

Turns out to be a frequent occurrence. Trading functions have not been called.

2020.06.03 15:23:21.428 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:26:09.433 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 8 ms.
2020.06.03 15:26:24.435 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 10 ms.
2020.06.03 15:26:31.417 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.06.03 15:26:33.429 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 8 ms.
2020.06.03 15:26:34.428 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 3 ms.
2020.06.03 15:26:55.655 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 18 ms.
2020.06.03 15:27:05.578 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 14 ms.
2020.06.03 15:29:27.613 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 3 ms.
2020.06.03 15:31:29.426 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 4 ms.
2020.06.03 15:31:46.430 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 11 ms.
2020.06.03 15:33:12.441 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 14 ms.
2020.06.03 15:33:21.437 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 12 ms.
2020.06.03 15:33:35.430 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:34:55.424 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 2 ms.
2020.06.03 15:35:09.426 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 2 ms.
2020.06.03 15:35:34.428 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 4 ms.
2020.06.03 15:41:48.423 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 3 ms.
2020.06.03 15:41:54.439 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 13 ms.
2020.06.03 15:42:28.440 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 15 ms.
2020.06.03 15:42:48.845 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 14 ms.
2020.06.03 15:43:08.429 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:43:25.428 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 7 ms.
2020.06.03 15:43:27.428 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 4 ms.
2020.06.03 15:43:48.436 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 9 ms.
2020.06.03 15:47:05.424 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 3 ms.
2020.06.03 15:47:46.426 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 8 ms.
2020.06.03 15:47:58.845 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 4 ms.
2020.06.03 15:48:47.140 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 12 ms.
2020.06.03 15:49:03.430 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:49:52.684 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 3 ms.
2020.06.03 15:53:39.429 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 4 ms.
2020.06.03 15:54:17.424 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:54:47.425 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.06.03 15:57:28.425 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 5 ms.
2020.06.03 15:57:47.425 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 2 ms.
2020.06.03 15:58:27.425 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 1 ms.
2020.06.03 15:59:08.445 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 23 ms.
2020.06.03 16:00:20.447 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 28 ms.
2020.06.03 16:01:50.430 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 7 ms.
2020.06.03 16:02:08.431 Alert: Time[NewTicks.mqh 28: ::SymbolInfoTick(_Symbol,Tick)] = 6 ms.

SymbolInfoTick is not a bad lag sometimes. HFT may be very experienced with such unexpected lags.

Please ask the Developers to find the reasons. In the meantime, it is obvious that in combat EAs their profiler is a must.

 
fxsaber:

Turns out to be a frequent occurrence. Trading functions have not been called.

SymbolInfoTick is not a bad lag sometimes. HFT may be very experienced with such unexpected lags.

Please ask the Developers to find the reasons. In the meantime, it's obvious that in battle EAs their profiler is a must.

How do you measure milliseconds with such accuracy? A hardware clock in your processor?

 
Alexey Volchanskiy:

How do you measure milliseconds with such precision? A hardware clock in the processor?

GetMicrosecondCount().

 
fxsaber:

Turns out to be a frequent occurrence. Trading functions have not been called.

SymbolInfoTick is not a bad lag sometimes. HFT may be very experienced with such unexpected lags.

Please ask the Developers to find the reasons. In the meantime, it is obvious that in battle EAs own profiler is a must.

the system timer has a 20ms step by default. did you reset it to a lower setting before the measurement?

you can try with functions like this:

#import "kernel32.dll"
   int timeBeginPeriod(uint TimerRes);
   int timeEndPeriod(uint TimerRes);
#import
 
Igor Zakharov:

The system timer has a default step of 20ms. did you reset it to a smaller step before measuring?

To the developers.

Forum on trading, automated trading systems and strategy testing

MT5 and speed in battle

Anton, 2020.05.29 12:32

The test code should look like this:

void OnStart()
  {
   MqlTick Tick;
   SymbolInfoTick(_Symbol, Tick);
   ulong start=GetMicrosecondCount();
   for(int i=0; i<100000; i++)
     {
      HistorySelect(Tick.time, INT_MAX);
     }
   ulong end=GetMicrosecondCount()-start;
   Print("100000 HistorySelect = ",DoubleToString(end/1000.0,2)," ms");
  }


Please do not theorise any more. This is a practical application branch.

 
fxsaber:

To the developers.

so this is the developers' response from several years ago.

 
Igor Zakharov:

so this is the developers' response from a few years ago.

Is it okay that the date is 2020.05.29 12:32

 
Alexey Viktorov:

Is it OK that the date is 2020.05.29 12:32

I was wrong, fxsaber pointed it out: GetTickCount() can screw up like I wrote, but GetMicrosecondCount() cannot.

https://www.mql5.com/ru/forum/189360#comment_4838735

I'll keep silent from now on :)