My approach. The core is the engine. - page 90

 
fxsaber:

Dear fxsaber.

I know that any data can be exchanged via resources.

But first, they must be converted into string and then, using StringToChar(), converted into uint, and saved into a resource. And the code for this is much simpler.

BUT, I proved that this method is slower than transferring the same string, via object description.


My opponents despise string type and speak about using mythical method of transferring all the data to uint at once through union.

Moreover, strings must also be converted into uint through union.


And why should strings be converted to uint via union when there is StringToChar()???

 
Maxim Kuznetsov:

Internally, there are only and only GlobalVariables and files for the exchange of data between EAs, indicators, and scripts.

All 4 above items are local "hacks" for want of fish. All of these 4 points are using mechanisms not designed to exchange arbitrary data, much less arrays of data.

п1. 100% leads to temporary locking of interface thread (yep, objects live there and their "descriptions" too) and doesn't work in optimizer. The object descriptions are for human-readable description of objects,

p2. n2. does not work in tester and optimizer, and serves to notify of events

P3. p4. resources (even named) are intended for long-term storage, not for quick exchange. I can't say anything about usability in tester/optimizer :-) I use read-only resources

there is no point in talking about the speed of curved solutions.

ps/ by the way you can use files, or rather pipes

You have written everything right.

But "hacks" are our everything.)

In the tester, in the optimization mode, the connection between the Expert Advisor and the engine will not work. There is no need for that.


For a meaningful exchange of parameter values at events, the EA and the engine must send to each other data up to 2000 characters in size. This is not much. But it's not so much.


The most useful hack is number 1.

Типы оптимизации - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
Типы оптимизации - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
  • www.metatrader5.com
В данном режиме происходит полный перебор всех возможных комбинаций значений входных переменных, выбранных для оптимизации на соответствующей вкладке. Быстрая (генетический алгоритм) В основу данного типа оптимизации заложен генетический алгоритм подбора наилучших значений входных параметров. Данный тип оптимизации значительно быстрее полного...
 
Реter Konow:

My opponents disdain the type string and talk about using the mythical method of transferring all data at once to uint, through union.

Moreover, strings must also be converted to uint via union.

Above code which converts several types at once (including not just strings but an array of strings) to uint and back.

But I don't think it will be useful in this discussion.


SZY If you really want to use strings.

Forum on trading, automated trading systems and testing trading strategies

Libraries: HistoryTicks

fxsaber, 2018.12.04 09:11

// Пример передачи/обмена данных между программами через поле комментария чартов

#include <fxsaber\HistoryTicks\Data_String.mqh> // https://www.mql5.com/ru/code/20298

void OnStart()
{
  int ArrayIn[] = {0, 1, 2, 3, 4, 5};  
  ChartSetString(0, CHART_COMMENT, DATA_STRING::ToString(ArrayIn));    // Записали данные в комментарий чарта

  int ArrayOut[];    
  DATA_STRING::FromString(ChartGetString(0, CHART_COMMENT), ArrayOut); // Прочли данные из комментария чарта
  
  ArrayPrint(ArrayOut);
}
 
fxsaber:

Above is code which translates several types at once (including not just strings, but an array of strings) to uint and back.

But I don't think it will be useful in this discussion.

So, you can translate an array of strings to uint through the union?

And is it faster than viaStringToChar()?

If you can, give a small and simple example. I can't make out your code.

 
Реter Konow:

So you can convert an array of strings to uint via union?

And is it faster thanStringToChar()?

If possible, please give a small and simple example. I can't make out your code.

The example was in this thread here.

To reproduce it, you need to link to the library referenced in the example code.

Мой подход. Ядро - Движок.
Мой подход. Ядро - Движок.
  • 2018.12.19
  • www.mql5.com
В этой ветке, я хочу рассказать о своем подходе в программировании. Заранее предупреждаю, - здесь не будет обсуждений GUI...
 
fxsaber:

...

ZS If you really want to go through the lines

What's the maximum comment size?

 
Реter Konow:

You've written it all right.

But "hacks" are our everything)).

In the tester, in the optimization mode, the link between the Expert Advisor and the engine will not work. You don't need it.


For a meaningful exchange of parameter values at events, the EA and the engine must send each other data up to 2000 characters in size. This is not too much. But it's also not a little.


The most convenient hack is number 1.

with this "most user-friendly hack", it is possible to step on the "children's rake", namely the templates that are much loved by users and used when reloading.
 
fxsaber:
...


ZS If you really want to go through the lines

The chart comment has a limited size. Or does it? I kind of stumbled across it.

 

Another serious question.

I haven't tried it myself, but there are doubts about the effectiveness of rapid exchange via resources.

Fast swap, - 16 milliseconds back and forth on a constant basis.

Will the disk not be overloaded?

 
Maxim Kuznetsov:
With this "most convenient hack" you can step on a "childish rake", namely, templates, very beloved by users and used at reloading.

Please explain.

ZS. Objects with special names will be used for communication. In order to avoid coincidence with user objects.

Reason: