Is cAlgo written to use all cpu cores?

Created at 20 Mar 2017, 01:04
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
lec0456's avatar

lec0456

Joined 14.11.2012

Is cAlgo written to use all cpu cores?
20 Mar 2017, 01:04


I can stress test my CPU and it utilizes 100% of CPU resources. 

cAlgo is only using 30% it is likely it was developed for single core utilization. To reach 100% the program needs to use multiple cores which means it must be programmed for multiple threads in parallel.

WAS cALGO WRITTEN TO USE MULTIPLE COORES, MULTIPLE THREADS IN PARRALLEL?

And if not, can you fix this?


@lec0456
Replies

Spotware
20 Mar 2017, 10:28

Hi lec0456,

Can you please elaborate when does cAlgo underutilize the processor so we can investigate? 


@Spotware

lec0456
20 Mar 2017, 14:30

Yes, when backtesting a cBot.  If use lets say a year worth of tick data,  It backtests the bot, but the cpu usage never gets above 30%.  Also, I had a c# developer look at the problem to tell me if my computer had any issues and he said the probelm is that cAlgo.exe it is only configured to use one core.


@lec0456

Spotware
20 Mar 2017, 14:51

When backtesting cAlgo just runs your cBot. If you want to utilize CPU 100% during backtesting you will need to paralellize your cBot's algorithm.


@Spotware

lec0456
20 Mar 2017, 18:08

How could I do this and do you have an example of how to do this?


@lec0456

Spotware
21 Mar 2017, 10:11

Hi lec0456,

There is no simple answer to this. In general, you will need to be familiar with parallel programming and use it while programming your cBot. Note that not all algorithms are parallelizable. There are a lot of good articles on the web regarding parallel programming using C# like the following

https://blogs.msdn.microsoft.com/csharpfaq/2010/06/01/parallel-programming-in-net-framework-4-getting-started/

Have a look at it if you are interested in getting deeper into the subject.


@Spotware