Download MetaTrader 5

Multicore/thread tester

To add comments, please log in or register
Jeremy Roach
2379
Jeremy Roach  

Hi all,

 Just wondering if there is an option somewhere that affects the use of multicore/thread CPUs in the MT5 tester?

I ask, as previously - up until yesterday my MT5 tester would stream through testing using all 8 cores, now it only does 1, then it might start using another core 3/4 through the whole test.

Does anyone know why this is going on and how to fix it?

My PC isn't doing much else other then testing.

Thanks 

jcollin.be
5
jcollin.be  

Hi,

 I also have an issue with the tester on my 8 core I7.

The Tester uses all the cores but it is very very slow and even much slower than on another machine 4 cores I5.
For the same EA, it takes 6 minutes to perform 100 passes on the 8 core and only 22 seconds on the 4 core!!! And I clean the cache before each execution.

 Is there something wrong with MT5 when run on 8 core machines?

Of course, solutions are welcome :)

 Ah and I cannot use the cloud or the remote agent as I use external dlls.

 Thank you for your answers? 

Lars Rompe
1678
Lars Rompe  

Hi both,

 

1. first of all you may want to check if all cores are really active

Therefore enter the msconfig (I assume you know how that works - keep in mind to do that changes as ADMIN) and click:

    • Win-R - msconfig
    • Boot tab 
    • Advanced Options
    • Number of Processors

You may check the processors that are actively used by Windows
msconfig cores

 

 2. You may limit the cores used by certain programs

Enter:

  • Press Ctrl+Alt+Del 
  • Start Task Manager 
  • Processes Tab 
  • right click desired program 
  • Set Affinity  
Adjust according to your expectations (e.g. to free some CPU for your regular work ;-))

Processes to cores association


3. Disable Hyperthreading Cores

In case you own Intel dual/multi-core - it has 4 "logical" cores and a quad-core has 8 "logical" cores which is meant by "Hyperthreading". 

I think Hyperthreading isn't working as it should in the marketing material - CPU is getting hot and the real benchmark results in the performance section of Windows do not improve.

Also subjective feeling is that it does not work.

You can disable these logical cores in the mainboard BIOS. 

You will have to press F2 during boot (or F8 or F12 in certain models) to enter BIOS. 

The option you have to look for is named "Hyperthreading [Enabled/Disabled]".


Enjoy!
Stephen Njuki
5241
Stephen Njuki  
Also make sure you have enough virtual memory per core/thread. Typically 2GB per thread is a minimum.
Ruy Bentes
198
Ruy Bentes  
What a great explanation, Lars! Thanks!!
TradeNzt
157
TradeNzt  

Hi! i have the same problem... i also modified my EA to work with classes and functions as OOP model require, but still backtest on a single core :-(   .. i urgently need help... 

Stanislav Korotky
23352
Stanislav Korotky  
TradeNzt:

Hi! i have the same problem... i also modified my EA to work with classes and functions as OOP model require, but still backtest on a single core :-(   .. i urgently need help... 


You have already asked this and got the answer here. No matter which paradigm you use - OOP or functional programming - single backtest runs on a single core/thread.

TradeNzt
157
TradeNzt  
Stanislav Korotky:

You have already asked this and got the answer here. No matter which paradigm you use - OOP or functional programming - single backtest runs on a single core/thread.


have you ever tried using dll? they are executed in separated threads.

Stanislav Korotky
23352
Stanislav Korotky  
TradeNzt:

have you ever tried using dll? they are executed in separated threads.

What exactly do you want to calculate in parallel? Probably there exist a better way to do what you're about to feed into threads according to your current design.

Bear in mind that trade execution in the tester is consecutive in any case.

Did you profile your code? Which parts induce the main time losses?

Code Profiling - Creating Programs - MetaEditor Help
Code Profiling - Creating Programs - MetaEditor Help
  • www.metatrader5.com
Profiling is a process of gathering application features, such as an execution time of its individual fragments (functions, lines). MetaEditor has integrated means of code profiling allowing a programmer to optimize a source code. Profiling can be performed on the normal chart of the trading platform, as well as using history data in the...
To add comments, please log in or register