Multicore - Parallel calculation, multithread EA to speedup backtests. - page 2

 
TradeNzt:

please read the question before answering :-)

yes i know please understand what is Hyper-threading :)
 
TradeNzt:

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

I did not try this myself, but i have worked with .dll files before. You can read this for further information:

https://www.mql5.com/en/docs/runtime/imports

You probably don't want to call trading functions like OrderSend in parallel since they will be executed sequencially regardless and it is not possible to call MQL functions from the .dll anyways.
I would suggest you to perform the raw calculations in the .dll file and use the results to send the orders.

EDIT: I am not 100% sure, but since MQL supports function pointers it may actually be possible to call functions like OrderSend from the .dll with a little bit of trickery. You could try passing a function pointer
to OrderSend itself or to a custom wrapper function of OrderSend into the .dll file. This way calling the function from inside the .dll might work, but as I said, I am not sure.

Documentation on MQL5: MQL5 programs / Call of Imported Functions
Documentation on MQL5: MQL5 programs / Call of Imported Functions
  • www.mql5.com
To import functions during the execution of a mql5-program, the client terminal uses early binding. This means that if a program has call of an imported function, the corresponding module (ex5 or dll) is loaded during the program load. MQL5 and DLL libraries are executed in the thread of a calling module. The system libraries (DLL)  are loaded...
 
Christian Peters:

I did not try this myself, but i have worked with .dll files before. You can read this for further information:

https://www.mql5.com/en/docs/runtime/imports

You probably don't want to call trading functions like OrderSend in parallel since they will be executed sequencially regardless and it is not possible to call MQL functions from the .dll anyways.
I would suggest you to perform the raw calculations in the .dll file and use the results to send the orders.

EDIT: I am not 100% sure, but since MQL supports function pointers it may actually be possible to call functions like OrderSend from the .dll with a little bit of trickery. You could try passing a function pointer
to OrderSend itself or to a custom wrapper function of OrderSend into the .dll file. This way calling the function from inside the .dll might work, but as I said, I am not sure.


You should avoid using custom .dll files. They are problematic at best, and a major security risk as worst.

 
Jack Thomas:


You should avoid using custom .dll files. They are problematic at best, and a major security risk as worst.


hi Jack Thomas, why you say problematic? have you ever tried to call mql5 trading functions by dll? for example open a position from dll, or change a stop loss from a dll. Thanks to all for answers.

Sabil Yudifera Daeng Pattah:
yes i know please understand what is Hyper-threading :)

dear Sabil, the problem that i'm exposing concern on how to code in mql5 to get all processors involved immediately in parallel (in single back test), you can have 100 cores but mql5 will always use one core. I know what is hyper threading, it speed up very partially... really unuseful if you don't code in multithread model.