fastquant icon indicating copy to clipboard operation
fastquant copied to clipboard

[FEATURE] Add multiprocessing support to backtest

Open ahmadsl opened this issue 3 years ago • 3 comments

Optimization of complex strategies takes too much time. Adding multiprocessing can solve the problem.

backtrader.cerebro can be used. definition.

ahmadsl avatar Apr 28 '21 10:04 ahmadsl

Hi @ahmadsl the default actually becomes all available cores as stated in the link you provided.

This is further discussed in the backtrader docs here: https://www.backtrader.com/blog/posts/2015-07-23-multicore-optimization/multicore-optimization/

maxcpus = None -> Use all available CPUs maxcpus = 1 -> Do not run multicore maxcpues = 2 … -> Use the indicated number of cores

If you have other suggestions for optimization please do let us know! Thanks :)

mikeejazmines avatar Dec 17 '21 13:12 mikeejazmines

@mikeejazmines, thanks for your reply. But I want to config this in Fastquant wrapper.

ahmadsl avatar Dec 17 '21 15:12 ahmadsl

@ahmadsl my bad! Understood. I have created the PR here https://github.com/enzoampil/fastquant/pull/402 I will just test it and merge it when done

mikeejazmines avatar Dec 18 '21 06:12 mikeejazmines