PyBroker
Python framework for backtesting trading strategies, especially machine-learning ones, with a Numba-accelerated engine and walk-forward analysis.
One of the few libraries that pushes you toward walk-forward testing and bootstrapped metrics, which is exactly what ML strategies need.
Who it is for
Python users who train models and want an honest out-of-sample test instead of one lucky backtest.
Strengths
- Walk-forward analysis for model training and backtesting.
- Bootstrapped metrics to estimate how reliable the results are.
- Data from Alpaca, Yahoo Finance, AKShare or your own source; Optuna parameter optimization.
Good to know
- The Commons Clause forbids selling the software or services whose value derives substantially from it; it is not OSI open source.
- Machine-learning strategies overfit easily; walk-forward reduces but does not remove the risk.
Want a bot built on PyBroker, or something similar?
We set it up, connect it to your accounts and keep it running.
Sources
Every fact on this page comes from these sources, checked on 2026-10-24. If something has changed, the source wins; tell us at hello@heybotify.com.
- https://github.com/edtechre/pybroker: features, data sources, installation, Apache 2.0 + Commons Clause license
Alternatives in Backtesting
Backtrader
Classic Python library for backtesting strategies, widely used in tutorials.
bt
Python library to backtest portfolio strategies (allocation, weighting, rebalancing) built from reusable building blocks.
Zipline Reloaded
Community-maintained version of Zipline, the event-driven Python backtester originally built and used by Quantopian.
QuantConnect (LEAN)
Cloud platform to research, backtest and trade strategies, built on the open-source LEAN engine.