MT5 and speed in action - page 66

 

Regarding the presented source code

#include <fxsaber\Benchmark\Benchmark.mqh> // https://www.mql5.com/ru/code/31279

void OnStart()
{
  for (int i = 0; i < 5; i++)
    _BV(Sleep(1), 1);
}

If you want speed, you should give up on this monster, because you are slowing yourself down.

This measuring tool is unsuitable because it introduces a huge error

In my script I put

#define  ITERATIONS 5

Here's the log for 5 iterations.

2020.11.04 16:37:24.430 TestSleep (EURUSD,H1)   total 9673 microseconds (1.935 ms per iteration)

Less than 2 milliseconds.

 
fxsaber:
The developers, by their silence, have fully acknowledged two problems.

The developers have admitted by their silence that there are no problems.

 
Slava:

Here is the log for 5 iterations

Less than 2 milliseconds.

Your script.

2020.11.04 16:46:40.341 Test9 (EURCHF,M1)       total 67620 microseconds (13.524 ms per iteration)


Machine.

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

The developers have admitted by their silence that there are no problems.

Handsome! Is it normal for ticks to come in with less time than in the Market Review before?

 
fxsaber:

Handsome! Is it normal for ticks to come in with less time than in the Market Review before?

Normal.

I answered this question 5 days ago, in the same thread:


SymbolInfoTick sends data received from the broker's server. What the server sent is what you get.

If there are questions about the tick stream broadcasted by your broker, you should contact your broker.

 
Slava:

The Expert queue is a lockable resource. When an event is written to the queue, the Expert Advisor waits (unless of course the Expert Advisor is currently processing an event)

Events for the Expert Advisor come from the event queue of the corresponding chart, which in turn comes from the processing cycle of the corresponding symbol. And this loop of processing not only distributes events to its own charts, but also does a lot of other things.

I have already told you that Windows is not a real-time operating system.

The task is very simply formulated: how to write an Expert Advisor that will not slow down while waiting for a queue? You cannot use an infinite loop because Sleep is a brake. So, asynchronous mode will not work at all. Now catching waits in the form of long milliseconds is not the point at all.

 
fxsaber:

Your script.


And for 10,000 iterations?

 
Slava:

And for 10,000 iterations?

2020.11.04 17:09:30.483 total 155965249 microseconds (15.597 ms per iteration)

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

 
Anton:

That's fine.

I answered this question 5 days ago, in the same thread:

SymbolInfoTick sends the data received from the broker's server. What the server sent is what you get.

If there are questions about the tick stream broadcasted by your broker, then you should contact your broker.

That is why I am asking the question to the owners of MQ-Demo.

 
fxsaber:

The problem is very simply formulated: how to write an EA that won't slow down when waiting for a queue? An infinite loop is impossible, because Sleep is a brake. And asynchronous mode will not work at all. Now catching waits in the form of long milliseconds is not the point at all.

Do not deceive yourself and those around you.

All your statements here describe quite a different task: how to write an Expert Advisor that won't feel sluggish on a 9 year old heavily loaded hardware.