Backtesting.py
Lightweight Python library to backtest a strategy on one asset with very little code.
The quickest way to test your first strategy idea in Python, with beautiful interactive charts.
Who it is for
Beginners who want to test a simple idea in minutes.
Strengths
- Simple, popular API (over 9,000 GitHub stars).
- Maintained: last change in August 2026.
Good to know
- AGPL-3.0 license: if you use it inside a web service offered to others, you must publish your code.
Want a bot built on Backtesting.py, or something similar?
We set it up, connect it to your accounts and keep it running.
Real-life uses
Walk-forward backtest lab
🔥 High demandOptimise on one period, test on the next, repeat. Get robust parameters, not lucky ones.
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 contact@tradebotcheck.com.
- https://github.com/kernc/backtesting.py: AGPL-3.0 license, popularity and date of the last change
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.
NautilusTrader
High-performance algorithmic trading platform (Rust core, used from Python) that runs the same strategy code in backtests and live.
PyBroker
Python framework for backtesting trading strategies, especially machine-learning ones, with a Numba-accelerated engine and walk-forward analysis.