Asynchronous and multi-threaded programming in MQL - page 31

 
Andrey Barinov , Generally your approach reminds me of Unix fork(). I think if MKs screw in regular fork() into terminal, it will be very elegant solution - those who want it will get relatively simple (in terms of necessary knowledge) multithreading, and all sorts of tricks with templates/graphics are not needed there.
 
Andrey Barinov:

On a standard chart, all events are present. On OBJ_CHART only OnChartEvent where the main EA sends OnTick and OnTimer if necessary.

So, OBJ_CHART draws the gui and handles the events of OnChartEvent and that is it?

The main driver of all events in OBJ_CHART is OnChartEvent(), so the events OnTick and OnTimer need to be sent through the EventChartCustom because the resources won't work? Or rather, they will work if they are read with command from OnChartEvent?

 
Реter Konow:

So, OBJ_CHART draws gui and handles OnChartEvent events and that's it?

The main driver of all events in OBJ_CHART is OnChartEvent() and OnTick and OnTimer events must be sent through EventChartCustom because the resources will not work? Or rather, will they work if they are read from OnChartEvent?

The GUI works in the main EA. It will also drop all the necessary events on the agents via OnChartEvent.

 
Andrey Barinov:

The GUI works in the main EA. It will also drop all the necessary events on the agents via OnChartEvent.

And what does agent(OBJ_CHART) do? Calculations?

 
Реter Konow:

And the agent(OBJ_CHART) does what? Calculations?

The calculations, the trading logic. Everything that is delegated to it (them). Ideally, everything that is not a GUI.

 
Andrey Barinov:

As long as they don't ban the use of templates in the Market. They could easily do so for security reasons.

 
fxsaber:

As long as they don't ban the use of templates in the Market. They could easily do so for security reasons.

Have you started trading?

 
fxsaber:

As long as they don't ban the use of templates in the Market. They could easily do so for security reasons.

We'll deal with problems as they arise :)

 
Andrey Barinov:

The calculations, the trading logic. Everything that is delegated to it (them). Ideally, everything that is not GUI.

And how do you get the results of the calculations back?

In principle, it can write them to a resource, right?

And if you need to pass an array of data for calculations? Give it a command through OnChartEvent() to access the resource, it will read the data, make the calculation, and then write the result to the resource?

But, in any case, the command can be given only through the EventChartCustom()?

And if we loop it after the first call, so that it would constantly access and read the resource and execute commands from it?

Sorry for the large number of questions. ))

 
Vict:

Have you started trading?

No, I was making a blog entry.