Multicore - Parallel calculation, multithread EA to speedup backtests.

 
Hi all community, i developed an EA and need to speedup backtests. I coded using classes and functions, i call them from main EA but i don't have speedup results (speed ramain the same by using only functions with no inclusion of classes). Backtest (with no optimizations) still run on a single core. I was wondering to run it in Multi Core and improve all cores performances. Is that possible? can someone explain a simple way? thanks a lot.
 
tradenzt:
Hi all community, i developed an EA and need to speedup backtests. I coded using classes and functions, i call them from main EA but i don't have speedup results (speed ramain the same by using only functions with no inclusion of classes). Backtest (with no optimizations) still run on a single core. I was wondering to run it in Multi Core and improve all cores performances. Is that possible? can someone explain a simple way? thanks a lot.

Of course, you can't run a single test on multiple cores because this is a sequential process. Every single tick/bar should be processed after all preceding ones in their respective order. This can not be executed in parallel.

 
Stanislav Korotky:

Of course, you can't run a single test on multiple cores because this is a sequential process. Every single tick/bar should be processed after all preceding ones in their respective order. This can not be executed in parallel.


That's ok, but partially correct and does not answer to the question :-) , of course ticks are processed sequentially by OnTick() event handler, but suppose that i have 10 operations to do every single tick... can i dispatch those 10 operations on different threads? (one operation--> on thread...)    ....  one way could be call scripts; scripts are executed on separated thread, but i don't think is possible to call script from EA, what is possible to do is call functions included in classes (i done it but doesn't increase performances and ea still work on a single core).

 
Edoardo Pietro Fiamingo:

That's ok, but partially correct and does not answer to the question :-) , of course ticks are processed sequentially by OnTick() event handler, but suppose that i have 10 operations to do every single tick... can i dispatch those 10 operations on different threads? (one operation--> on thread...)    ....  one way could be call scripts; scripts are executed on separated thread, but i don't think is possible to call script from EA, what is possible to do is call functions included in classes (i done it but doesn't increase performances and ea still work on a single core).

MQL does not support parallelism inside. You have no means to run multiple functions of the same EA/script on separate threads/cores.

 

If you do not plan to distribute your EA on the market, you could create a custom .dll file (in c++ for instance) that will handle the parallelism.

In MQL you can import the .dll file and use it as a library.

 
Christian Peters:

If you do not plan to distribute your EA on the market, you could create a custom .dll file (in c++ for instance) that will handle the parallelism.

In MQL you can import the .dll file and use it as a library.

i've read about that but how to call dll from ea? in every case i don't know if is useful cause i can't perform orders from c++ ... or i can?
 
Sabil Yudifera Daeng Pattah:
see this https://en.wikipedia.org/wiki/Hyper-threading
i already enabled but it's not enought
 
TradeNzt:
i already enabled but it's not enought

you can use a server computer with multiple processors.

example one computer has 100 processors

 
Sabil Yudifera Daeng Pattah:

you can use a server computer with multiple processors.

example one computer has 100 processors


please read the question before answering :-)

 
Christian Peters:

If you do not plan to distribute your EA on the market, you could create a custom .dll file (in c++ for instance) that will handle the parallelism.

In MQL you can import the .dll file and use it as a library.


did you tried? if yes did you had all cores working in single test? (not optimization)