Theory of EA acceleration when using a custom indicator (function - iCustom) - page 9

 
-Aleks-:
Thank you.
This is the case for MT4. In MT5 there will be one instance in both cases
 
Dmitry Fedoseev:
This is the case for MT4. In MT5 there will be one copy in both cases

I see.

Since Renat is silent and no one knows when the memory bug will be fixed, I decided to pay for transferring the script code to the Expert Advisor.

 
Can you please tell me if there is an indicator in the code of an MT4 Expert Advisor, but it is not called (the user did not call it in the settings or the algorithm does not stipulate that or if it is always possible to call indicator A or B), will memory be allocated for it?
 
-Aleks-:

But, if this is not the case, why not combine the information from the indicator into one pack?

I propose to make an experiment on this topic with measuring the performance of the EA.

This will require taking a custom indicator with more than 1 buffer and adding an additional buffer.

The algorithm is logical (no mathematical):

1. Convert the buffers in the indicator to integers, depending on the digits per number, a total of 3 buffers, was: 1,21101; 1,13; 5, became: 121101;113;5

2. We count how many digits to put after the first number - in our case 4, then in the next number the next one - 1, these values are the degree of the multiplier:

1,21101*10^4=1211010000

1.13*10^1=113

5*10^0=5 (check for 0)

3. Sum the numbers and obtain 1211011135.

4. Write the value to the 4. buffer

5. We request the 4 indicator buffer in the Expert Advisor and decompose the value into components in reverse order and obtain 3 digits that can be further used for the work of the Expert Advisor.

Can someone compare the speed of this approach, is there a rationale behind it?

I checked this theory not so long ago - it turned out that the graphical buffer has serious limitations that do not allow to glue values of other buffers, especially if they reflect instrument's price. However, I made a method using the same principle of calculation of the indicator function and built the function in my Expert Advisor and now I get three buffers of the virtual indicator at once for one request - the performance gain in this case is proportional to the number of responses of the function to the request.