kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.06k stars 990 forks source link

why its so slow? #1011

Open efeint01 opened 1 year ago

efeint01 commented 1 year ago

im using this library and already enabled multiproccesing by mp.set_start_method('fork') on Windows 11 My strategy little bit hard. I tested on 7700 Candles and its really took my 15 minutes.

Here is my optimize code:

    stats = bt.optimize(
        maximize=optim_func,
        # method="grid",
        max_tries=50
    )

What should i do for increasing the speed? This question may be stupid sorry for that. I'm a beginner, Thanks.

Jay90194 commented 12 months ago

Try using Vector BT. It uses Numba, which is much faster than Pandas. Though the Non-pro version is not maintained by the owner. Still, give it a try.