MT5 and speed in action - page 85

 
Anton:

@Anton, in many standard functions you can specify NULL instead of a character. Does it affect the speed of execution?

SymbolInfoTick(NULL, Tick);

SymbolInfoTick(_Symbol, Tick);

Or does it make no difference to the Terminal/Tester?

 
fxsaber:

@Anton, in many standard functions you can specify NULL instead of a character. Does it affect the speed of execution?

Or is there no difference for Terminal/Tester?

I can't say for sure, but intuitively I never write NULL anywhere.

Theoretically, it shouldn't make a difference. I think when compiling NULL changes to a normal value, and I don't like seeing incomprehensible things with my eyes.

 
Alexey Viktorov:

I can't say for sure, but intuitively I never write NULL anywhere.

Theoretically, it should have no effect. I think NULL changes to a normal value when compiling, and I don't like seeing things that don't make sense to my eyes.

The same is true. But it's the speed that worries me.

 

I don't understand how SymbolInfoTicks can slow down in a seconds timer at the weekend!

2021.02.28 21:33:02.993 ::SymbolInfoTick(_Symbol,Tick) = 171 mcs.

20 charts of different symbols, on each one an EA is running, which only takes a tick of its symbol in the second timer.

What's there to slow down on a day off?!


SZY 3374 MB in the screenshot - that's an hour ago requesting ticks for the week. Saving resources like this.

 
fxsaber:

I don't understand how SymbolInfoTicks can slow down in a seconds timer at the weekend!

20 charts of different symbols, on each one an EA is running, which only takes a tick of its symbol in the second timer.

What's there to slow down on a weekend day!

You have:

  1. lack of information
  2. a couple dozens of Expert Advisor threads running in parallel on 4 cores (8 with hyperthreading can be ignored)
  3. again a single outlier from a long wait is found?
  4. again a single random system latency at the will of the thread manager?


 
Renat Fatkhullin:

You have:

  1. lack of information
  2. a couple dozen expert threads running in parallel on 4 cores (8 with hyperthreading can be disregarded)
  3. again a single outlier from a long standby is found?
  4. Again a single random system latency at the will of the thread manager?

I'm wondering why SymbolInfoTick is such a select function for the latency?

 
fxsaber:

I'm wondering why SymbolInfoTick is such a chosen function for braking?

It is not.

You will always catch random delays anywhere in any program. Start keeping track of everything and you'll be horrified at the realities of Windows. I've already explained this in detail several times.

At one time we too were astonished when we caught random bursts of 60-80 ms instead of 0 ms on system WinAPI functions.


Now we're migrating most of our Windows solutions en masse to specially skimmed Windows Server 2019 Core versions, and .NET Core web projects to Linux. This brings tremendous savings in system resources and seriously reduces system latency.

The first step in skimming the MataTrader 5 terminals was to start implementing a task manager to keep track of resource consumption on the fly. For ourselves, we are collecting more information.

It has already been revealed that we:

  • excessively long withholding unnecessary flows
  • over-scaling
  • Overextending caches.
By the next release we will fix some of the resource issues step by step.
 
Alexey Viktorov:

Theoretically, it should have no effect. I think NULL changes to a normal value when compiling, and I don't like seeing incomprehensible things with my eyes.

Theoretically it should have an effect, but it won't because the

SymbolInfoTick(_Symbol, Tick);

_Symbol is passed not by value (as follows from description in Help) but by reference

 
Renat Fatkhullin:

It is not.

You will always catch random delays anywhere in any programme. Start keeping track of everything and you will be horrified at the realities of Windows. I've explained this in detail several times before.

Thanks, I will check it out.


Please think about such a feature.

int SymbolInfoTicks( const string Symb, MqlTick &Ticks[] ); // Возвращает свежие тики (не более сотни), пришедшие с предыдущего вызова этой функции.


The problem of getting LATE ticks without skips is now only solved via CopyTicks*. It's a very cumbersome mechanism for this widespread task. It's like shooting birds with a cannon.

Hence brakes, retention of huge caches, etc.

 
A100:

Theoretically it should have an effect, but it doesn't, because in

_Symbol is not passed by value (as the description in Help suggests), but by reference

Inside the function, we still need to pass to the appropriate tick character. This is the time needed to analyze the string-variable. This is not necessary with NULL.