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

 
Реter Konow:

Another serious question.

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

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

Isn't the drive going to be overloaded?

You are falling into the "sin of premature optimization" :-)

Make a class (or set of functions, if GSE doesn't appeal to you) of data exchange - if in real projects it will lag, then you'll think over the options. And in the meantime you will be busy with senseless tests for another half a year.

PS by the way have you done anything to present the project to the public? or are you just scratching your ego on the forum traditionally :-)

 
Artyom Trishkin:

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

I think there are limitations. I myself only pass MqlTick-ticks to EventChartCustom via strings, as the event-queue saves the sequence of ticks. It's awfully convenient.

 
Реter Konow:

That is, you can translate an array of strings into uint through union?

I don't remember how it's implemented, but I can translate not only string arrays, but other data types into any type (even in MqlTick). The code will be the same.

And it's faster than usingStringToChar()?

I don't know. Try MqlTick to string using your method and then via StringToChar to uint. And vice versa, of course. Measure and compare.

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

#include <TypeToBytes.mqh> // https://www.mql5.com/ru/code/16280

void OnStart()
{    
  string Str[] = {"123", "Hello World!", "Peter Konow"};

  CONTAINER<uint> Container; // Создаем контейнер - все будет храниться в массиве простого типа (в примере выбран uint)    
  Container[0] = Str;        // Записали в контейнер строковый массив
  
  CONTAINER<uint> Container2;                 // Создаем контейнер-получатель  
  ArrayCopy(Container2.Data, Container.Data); // Скопировали в него ТОЛЬКО содержимое uint массива

  string Str2[];
  Container2[0].Get(Str2); // Получили данные в исходном виде
  ArrayPrint(Str2);
}
 
fxsaber:

I think there are limitations. I myself only pass MqlTick-ticks to EventChartCustom via strings, as the event-queue saves the sequence of ticks. It's really handy.

If the question is about small messages (up to 64 characters) and constant fast passing back and forth, there are several convenient options.

And EventChartCustom is not the best one, because it gets into OnChartEvent() event queue.

But when it comes to fast back and forth transfer of more than 1000 symbols, EventChartCustom and event queue lead to delays (for example, when reloading tables and using animation).

Fast pass through resources is questionable.

Tell me, it won't load a disk?

 

Judging by the silence - it probably will.

There you go, check it out.)

 
Реter Konow:

Fast transfer via resources - in question.

Forum on trading, automated trading systems and trading strategy testing

New version of MetaTrader 5 build 1930: Floating chart windows and .Net libraries in MQL5

fxsaber, 2018.12.09 00:18

This example now runs 15x faster

1000000
Time[TestResource()] = 286646


Roughly speaking, a full write/read ticks cycle through the resource runs at 4 million ticks per second.


Here's a word, won't it put a load on the drive?

The disk is not used in the resource operation. Everything is in memory.

Forum on trading, automated trading systems and trading strategies testing

Bugs, bugs, questions

fxsaber, 2018.12.11 09:19

Checked, 60Mb is safely (MT4/5) written to Resources. So if there is a limit, it's higher.

 
fxsaber:


The drive is not used when working with resources. Everything is in memory.

Thank you. So this option remains.

 
fxsaber:


The drive is not used when dealing with resources. Everything is in memory.

What about the tester? Will the resources created in the tester be visible outside the tester? And are they created in the tester at all?

ZS. A comrade here, said that the resources - it is unknown whether they work in the tester.))
 
Реter Konow:

What about the tester? Will the resources created in the tester be visible outside the tester?

And are they created in the tester at all?

I have not checked if the resources work in the Strategy Tester. If they do work there, they will be visible in MT4 because the Tester is inside the Terminal, but not in MT5 because the Tester is not connected with the Terminal. You can exchange files there only through Common files.


When I looked at the above information, I got one way, I asked myself a question and answered it by checking the code. I recommend it.

 
fxsaber:

I have not checked if the resources work in the Strategy Tester. If they work there, they will be visible in MT4, because the tester is inside the terminal, but not in MT5, because the tester is not connected to the terminal in any way. Only exchange is possible there through Common-files.

I see. I need to check it. I will check it today.

Reason: