MT5 and speed in action - page 68

 
pivomoe:

29gb disk. The tests are from home machines and I understand you are either from a VPS or a virtual machine.

This is how the SSDs are partitioned. The last one (Z:) is the RAM disk for the MT5 tester.

 

My Sleep(1) test

Windows 10 build 17134, Intel Core i7-2600  @ 3.40 GHz, 7 / 15 Gb memory, 97 / 195 Gb disk, IE 11, UAC, GMT+3
TestSleep (PLD-12.20,M1)        total 19979585 microseconds (1.998 ms per iteration)

p.s I seem to have an even weaker computer than yours.

Yours:

2020.11.04 16:47:52.962 Terminal        Windows 10 build 19042, Intel Core i7-2700 K  @ 3.50 GHz, 7 / 15 Gb memory, 18 / 29 Gb disk, IE 11, Admin, GMT+2
 
What is your operating system? Probably some LTSC version for ATMs ?
 
fxsaber:

I invite others to share the result of running this script on their machine.

2020.11.04 21:28:02.430 Terminal        MetaTrader 5 x64 build 2669 started for MetaQuotes Software Corp.
2020.11.04 21:28:02.430 Terminal        Windows 7 Service Pack 1 build 7601, Intel Core i7-2670 QM  @ 2.20 GHz, 5 / 7 Gb memory, 40 / 119 Gb disk, IE 11, UAC, GMT+3
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1535 mcs.
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)   [0] 1.17176 1.17183     true    1913026
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)   [1] 1.17176 1.17183    false        838
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)   [2] 1.17177 1.17184     true     285603
2020.11.04 21:42:01.171 test fxsaber lags (EURUSD,M1)   [3] 1.17177 1.17184    false       1535
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1601 mcs.
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)   [0] 1.17177 1.17184     true     285603
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)   [1] 1.17177 1.17184    false       1535
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)   [2] 1.17178 1.17185     true     339894
2020.11.04 21:42:01.513 test fxsaber lags (EURUSD,M1)   [3] 1.17178 1.17185    false       1601
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1542 mcs.
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)   [0] 1.17178 1.17185     true     339894
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)   [1] 1.17178 1.17185    false       1601
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)   [2] 1.17177 1.17185     true     658901
2020.11.04 21:42:02.173 test fxsaber lags (EURUSD,M1)   [3] 1.17177 1.17185    false       1542
2020.11.04 21:42:02.786 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1611 mcs.
2020.11.04 21:42:02.786 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:02.786 test fxsaber lags (EURUSD,M1)   [0] 1.17177 1.17184     true     309509
2020.11.04 21:42:02.787 test fxsaber lags (EURUSD,M1)   [1] 1.17177 1.17184    false        935
2020.11.04 21:42:02.787 test fxsaber lags (EURUSD,M1)   [2] 1.17177 1.17185     true     301094
2020.11.04 21:42:02.787 test fxsaber lags (EURUSD,M1)   [3] 1.17177 1.17185    false       1611
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1541 mcs.
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)   [0] 1.17177 1.17185     true     409488
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)   [1] 1.17177 1.17185    false        847
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)   [2] 1.17178 1.17185     true    3609403
2020.11.04 21:42:07.702 test fxsaber lags (EURUSD,M1)   [3] 1.17178 1.17185    false       1541
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1559 mcs.
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)   [0] 1.17177 1.17184     true     306847
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)   [1] 1.17177 1.17184    false        829
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)   [2] 1.17178 1.17185     true     315408
2020.11.04 21:42:08.620 test fxsaber lags (EURUSD,M1)   [3] 1.17178 1.17185    false       1559
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)   Alert: OnTick-lag! - 906601 mcs.
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)   [0] 1.17174 1.17179    false        809
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)   [1] 1.17173 1.17180     true     592027
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)   [2] 1.17173 1.17180    false        769
2020.11.04 21:42:12.018 test fxsaber lags (EURUSD,M1)   [3] 1.17173 1.17180     true     906601
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)   Alert: OnTick-lag! - 6976 mcs.
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)   [0] 1.17173 1.17180    false        769
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)   [1] 1.17173 1.17180     true     906601
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)   [2] 1.17174 1.17181    false     808595
2020.11.04 21:42:12.834 test fxsaber lags (EURUSD,M1)   [3] 1.17174 1.17181     true       6976
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1323 mcs.
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)   [0] 1.17168 1.17175     true     104187
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)   [1] 1.17168 1.17175    false        566
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)   [2] 1.17167 1.17175     true     292558
2020.11.04 21:42:16.340 test fxsaber lags (EURUSD,M1)   [3] 1.17167 1.17175    false       1323

Completely unloaded computer, all background processes stopped, one terminal running with one chart without indicators.


Weak VPS:

MetaTrader 5 x64 build 2650
2020.11.04 21:55:15.582 Terminal        Windows Server 2012 R2 build 9600, QEMU Virtual  version (cpu64-rhel6), 0 / 0 Gb memory, 3 / 19 Gb disk, IE 11, RDP, UAC, Admin, GMT+3
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 3002 mcs.
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)   [0] 1.17164 1.17170    false    2215173
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)   [1] 1.17164 1.17170     true         16
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)   [2] 1.17165 1.17173     true     505195
2020.11.04 22:05:32.637 test fxsaber lags (EURUSD,M1)   [3] 1.17165 1.17173    false       3002
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 6365 mcs.
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)   [0] 1.17169 1.17174     true    1622392
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)   [1] 1.17169 1.17174    false        736
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)   [2] 1.17169 1.17175     true     275705
2020.11.04 22:05:39.546 test fxsaber lags (EURUSD,M1)   [3] 1.17169 1.17175    false       6365
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 6172 mcs.
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)   [0] 1.17165 1.17172    false     317312
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)   [1] 1.17165 1.17172     true         15
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)   [2] 1.17164 1.17172     true     680826
2020.11.04 22:05:41.953 test fxsaber lags (EURUSD,M1)   [3] 1.17164 1.17172    false       6172
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 6254 mcs.
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)   [0] 1.17163 1.17170    false    3112999
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)   [1] 1.17163 1.17170     true        104
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)   [2] 1.17164 1.17170     true     285972
2020.11.04 22:05:45.359 test fxsaber lags (EURUSD,M1)   [3] 1.17164 1.17170    false       6254
2020.11.04 22:06:01.032 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 1104 mcs.
2020.11.04 22:06:01.033 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:06:01.033 test fxsaber lags (EURUSD,M1)   [0] 1.17163 1.17170     true     376698
2020.11.04 22:06:01.033 test fxsaber lags (EURUSD,M1)   [1] 1.17163 1.17170    false         43
2020.11.04 22:06:01.033 test fxsaber lags (EURUSD,M1)   [2] 1.17165 1.17171     true     324610
2020.11.04 22:06:01.033 test fxsaber lags (EURUSD,M1)   [3] 1.17165 1.17171    false       1104
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)   Alert: OnBook-lag! - 6866 mcs.
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)         [bid]   [ask] [onTick] [Interval]
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)   [0] 1.17166 1.17173    false     910870
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)   [1] 1.17166 1.17173     true         17
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)   [2] 1.17168 1.17174     true     265755
2020.11.04 22:06:04.826 test fxsaber lags (EURUSD,M1)   [3] 1.17168 1.17174    false       6866
 
Slava:

Not always and not everywhere a tenth of a millisecond. Checked with a simple script

Here is my log

OnTick users always see the freshest tick.

OnBookEvent users always see the freshest tick.

But if you want to compare ticks received with OnTick and received with OnBookEvent you're in for a disappointment because the events are processed sequentially and not in parallel. What user pivomoe tried to tell you

The handlers are handled in series? This is fundamentally wrong!
All the handlers should run in parallel!
And where's that statement about everything being asynchronous in mt5?

Please comment on this!

SymbolInfoTick() is executed in blocking mode or non-blocking?

For example, it is located in the body of while loop and there is no connection or market is closed for weekend,
it will be blocked by stopping the loop or it will be executed asynchronously?


 
pivomoe:
What is your operating system? Probably some LTSC version for ATMs ?

I don't know where to look.


 
fxsaber:

I invite others to share the result of running this script on their machine.

2020.11.04 22:46:21.383 TestSleep (BR-11.20,M15)        total 10001544 microseconds (1.000 ms per iteration)

FX-8350

 

TestSleep:

2020.11.04 22:58:12.246 test1 (EURUSD,H1)       total 155486725 microseconds (15.549 ms per iteration)

All on the same hardware, terminal build 2650

2020.11.04 12:18:51.145 Terminal        Windows 10 build 19041, AMD Ryzen 5 1600 Six-Core Processor, 12 / 15 Gb memory, 140 / 446 Gb disk, IE 11, UAC, GMT+3

On a weak VPS

2020.11.04 23:17:10.795 Terminal        Windows Server 2012 R2 build 9600 on KVM, Intel Xeon  E5-2630 v4 @ 2.20 GHz, 1 / 1 Gb memory, 46 / 59 Gb disk, IE 11, RDP, UAC, Admin, GMT+3
2020.11.04 23:22:13.630 test1 (GBPUSD,M1)       total 164085014 microseconds (16.409 ms per iteration)
 

Script

2020.11.04 22:58:09.400 fxsaberTest (USDSGD,M1) total 10335638 microseconds (1.034 ms per iteration)

2020.11.04 22:55:36.860 Terminal        MetaTrader 5 x64 build 2660 started for MetaQuotes Software Corp.
2020.11.04 22:55:36.914 Terminal        Windows 7 Service Pack 1 build 7601, Intel Core i3-3220  @ 3.30 GHz, 1 / 7 Gb memory, 40 / 298 Gb disk, IE 11, UAC, GMT+3

Advisor on the same machine

2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 9278 mcs.
2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)        [0] 1.35782 1.35829     true     798967
2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)        [1] 1.35782 1.35829    false         10
2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)        [2] 1.35784 1.35828     true    1002847
2020.11.04 23:11:49.269 fxsaberTest1 (USDSGD,M1)        [3] 1.35784 1.35828    false       9278
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 1138 mcs.
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)        [0] 1.35785 1.35831     true     995884
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)        [1] 1.35785 1.35831    false         19
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)        [2] 1.35784 1.35830     true    1494938
2020.11.04 23:11:51.759 fxsaberTest1 (USDSGD,M1)        [3] 1.35784 1.35830    false       1138
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 1725 mcs.
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)        [0] 1.35784 1.35830     true    1494938
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)        [1] 1.35784 1.35830    false       1138
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)        [2] 1.35784 1.35831     true    2513478
2020.11.04 23:11:54.274 fxsaberTest1 (USDSGD,M1)        [3] 1.35784 1.35831    false       1725
2020.11.04 23:12:24.780 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 8871 mcs.
2020.11.04 23:12:24.781 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:24.781 fxsaberTest1 (USDSGD,M1)        [0] 1.35780 1.35826    false    1393401
2020.11.04 23:12:24.781 fxsaberTest1 (USDSGD,M1)        [1] 1.35780 1.35826     true          3
2020.11.04 23:12:24.781 fxsaberTest1 (USDSGD,M1)        [2] 1.35780 1.35827     true    2911594
2020.11.04 23:12:24.781 fxsaberTest1 (USDSGD,M1)        [3] 1.35780 1.35827    false       8871
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 8739 mcs.
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)        [0] 1.35780 1.35828     true     793665
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)        [1] 1.35780 1.35828    false        232
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)        [2] 1.35785 1.35828     true    1100758
2020.11.04 23:12:26.676 fxsaberTest1 (USDSGD,M1)        [3] 1.35785 1.35828    false       8739
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 1073 mcs.
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)        [0] 1.35778 1.35828     true     882728
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)        [1] 1.35778 1.35828    false        229
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)        [2] 1.35777 1.35828     true    1003699
2020.11.04 23:12:32.486 fxsaberTest1 (USDSGD,M1)        [3] 1.35777 1.35828    false       1073
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 1070 mcs.
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)        [0] 1.35775 1.35826     true    1595418
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)        [1] 1.35775 1.35826    false         22
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)        [2] 1.35775 1.35827     true    1010723
2020.11.04 23:12:35.094 fxsaberTest1 (USDSGD,M1)        [3] 1.35775 1.35827    false       1070
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)        Alert: OnBook-lag! - 1001 mcs.
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)        [0] 1.35772 1.35823     true    2806395
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)        [1] 1.35772 1.35823    false        260
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)        [2] 1.35772 1.35824     true     997459
2020.11.04 23:12:40.507 fxsaberTest1 (USDSGD,M1)        [3] 1.35772 1.35824    false       1001
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)        Alert: OnTick-lag! - 66461 mcs.
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)              [bid]   [ask] [onTick] [Interval]
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)        [0] 1.35776 1.35824     true    1099872
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)        [1] 1.35776 1.35824    false        467
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)        [2] 1.35776 1.35825    false    1805312
2020.11.04 23:12:43.479 fxsaberTest1 (USDSGD,M1)        [3] 1.35776 1.35825     true      66461
 
Roman:

The handlers are executed sequentially??? This is fundamentally wrong!

How do you imagine it - parallel processing in one thread?

Reason: