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

 
Nikolai Semko:
Peter, where is the proof?
Where is the research report comparing execution speeds of one program in one ex5 thread (there is even no sense to experiment with ex4) and in two threads?
It was only a hypothetical supposition, which, by the way, was stated for the first time by me ( here), when I didn't receive at least one formulation of advantages of your approach from you.
You are already using my hypothesis as a fact.
Personally I admit that there may be an advantage, but purely on intuition (not on knowledge) I bet 75% that it will not give any advantage, since the interaction and data exchange between the two programs is not free, and the processor is one for both ex5. But the answer to this question can only be given by the developers themselves or a qualitative experiment.

I can provide you with proof of the low cost of data exchange between programs. Even when passing a string of thousands of characters. I've made an experiment. I'll find and upload two test EAs. Communication via resources does not load the processor, only redrawing.

The engine will accumulate a wide range of functionality, and only a small part - the user's GUI. That is, the engine will include code that will only partially be required by a separate application, and the rest of the code can be used by other applications on other graphics. In this way, the engine becomes an auxiliary functionality used by different EAs at the same time, and therefore, it should be a separate program running in its own thread.

 

Here. Put it on the first graph.

//+------------------------------------------------------------------+
//|                                                       TEST_2.mq4 |
//|                                                      Peter Konow |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Peter Konow"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
union Char_Uint{uchar Char[32000]; uint Uint[8000];};
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   EventSetMillisecondTimer(16);
   //----------------------------------------------
   if(!ObjectCreate(0,"Resource",OBJ_BITMAP_LABEL,0,0,0))Print("Object is not created!  ",GetLastError());
   else Print("Object created!");
   //-------------------------------
   if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"::Resource"))Print("BMPFILE is not created!");
   else Print("BMPFILE created!");
   //----------------------------------------------
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
   Char_Uint u;
   string String = NULL;
   int q = MathRand(),w = 0;
   if(q > 10000)q = 10000;
   //-------------------------------------------------------
   //Формируем случайную строку.
   //-------------------------------------------------------
   for(int a1 = 0; a1 < q; a1++)
      {
       String += (string)a1 + "^";
       w++;
       if(w == 10)
         {
          String += "$";
          w = 0;
         }
      } 
   //-------------------------------------------------------
   //Получаем размер собранной строки.
   //-------------------------------------------------------
   int StrSize = StringLen(String);
   //-------------------------------------------------------
   //Копируем строку в массив Char[].
   //-------------------------------------------------------
   StringToCharArray(String,u.Char);
   //-------------------------------------------------------
   //Cохраняем строку переведенную в байты в ресурсе.
   //-------------------------------------------------------
   if(!ResourceCreate("::Resource",u.Uint,8000,1,0,0,0,COLOR_FORMAT_XRGB_NOALPHA))Print("Resource is not created!");
   //-------------------------------------------------------
  }
//+------------------------------------------------------------------+
 

And this one is on the second.

//+------------------------------------------------------------------+
//|                                              Resource reader.mq4 |
//|                                                      Peter Konow |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Peter Konow"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

//+------------------------------------------------------------------+
union Char_Uint
  {
   uchar   Char[32000];
   uint    Uint[8000];   
  };
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   EventSetMillisecondTimer(16); 
   
   if(!ObjectSetString(0,"Resource",OBJPROP_BMPFILE,"\\Experts\\TEST_2.ex4::Resource"))Print("Resource is not connected!");
   else Print("Resource connected!");
//---
   return(INIT_SUCCEEDED);
  }


//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
   Char_Uint u;   
   uint width,height;
   string msg[],pars[];
   //-----------------------------
   if(!ResourceReadImage("\\Experts\\TEST_2.ex4::Resource",u.Uint,width,height))Print("Failed to read resource!  ",GetLastError());
   //-----------------------------
   string String = CharArrayToString(u.Char);
   //-----------------------------
    ushort Msep = StringGetCharacter("^",0);
    int s = StringSplit(String,Msep,msg);
    for(int a1 = 0; a1 < s; a1++)
      {
       ushort Psep = StringGetCharacter("$",0);
       StringSplit(msg[a1],Psep,pars);
     }  
   //-----------------------------
   Alert("  String  ",String);
   //-----------------------------
    //------------------------------------------------------------------------------------------------------- 
    ArrayInitialize(u.Char,0);
    ResourceCreate("\\Indicators\\DRIVE.ex4::EA_2_DRIVE",u.Uint,8000,1,0,0,0,COLOR_FORMAT_ARGB_RAW);
    //-------------------------------------------------------------------------------------------------------      
  }
//+------------------------------------------------------------------+
 
Реter Konow:

I can provide proof of the low cost of exchanging data between programmes. Even when transferring a string of thousands of characters. I did an experiment. I'll find and upload two test EAs. Communication through resources does not load the processor, only redrawing.

The engine will accumulate a wide range of functionality, and only a small part - the user's GUI. That is, the engine will include code that will only partially be required by a separate application, and the rest of the code can be used by other applications on other graphics. In this way, the engine becomes an auxiliary functional centre used by different EAs at the same time, and therefore, it must be a separate programme.

But if one engine serves multiple programs, then all the more it will slow down the overall process, because serving different programs in it will happen sequentially, while instances of your engine class in each application will run in parallel.
 
The second EA has Alert. As long as it is open, the processor will be stressed. As soon as you comment it out, the load will disappear.
 
Nikolai Semko:
But if your engine serves several applications, then it will slow down the whole process, because it will serve different programs sequentially, while instances of your engine class in each application will run in parallel.

The programs will access the engine asynchronously and as needed. One will request to build a graph based on the array passed to it, the other to calculate a value using a formula, the third something else... All of this will not be a single continuous process, but will occur from time to time.

In this case, the engine will carry the GUI of one of the applications, and the user will switch to the GUI of another application.

 
If you put the engine in an application, there is a lot of unnecessary stuff in the application. So, you need to customise the engine to the specific needs of the individual EA. The user will not be able to cope with this. It is long and complicated. And it will prevent me to develop the versatility of the engine.
 
Реter Konow:
If you put the engine in an application, there is a lot of unnecessary stuff in the application. So, you need to customise the engine to the specific needs of the individual EA. The user will not be able to cope with this. It is long and complicated. And it will interfere with the development of the engine's universality.
It is just a set of words without any meaning.
 
Nikolai Semko:
Just a bunch of words without any meaning.

Just take my word for it. I know what I'm doing.

 
Реter Konow:

Just take my word for it. I know what I'm doing.

No, you don't. You don't.