Home / Backtesting & trading frameworks
bt
Flexible Python backtesting framework for investment strategies
What it is
A Python backtesting library for building, testing, and comparing investment strategies from reusable components. It combines strategy logic with historical price data, tracks portfolio positions and transactions, models commissions and other trading costs, and reports statistics and charts through ffn. Strategy logic is composed from algorithms for scheduling, security selection, weighting, and rebalancing, and strategies can be nested into portfolio trees. This suits quants and researchers who want to experiment with strategies in Python; results depend on data quality and modeling assumptions and do not predict future performance.
At a glance
Worth watchingOur rating, based on popularity, maintenance and how ready it is for real use.
| Best for | Beginners |
|---|---|
| Used for | Backtesting, Strategy research |
| Markets | Multi-market |
| Stack | Python |
| Learning curve | Easy to start |
| Practical value | Medium practical value |
| Cost | Free and open source |
| Hardware | No GPU needed |
| Maintenance | Commits today |
GitHub stars, last 30 days
Daily snapshots since 2026-09-12 (up to 30 days): +15 over the period, now 2,996. Gaps mean no snapshot was taken that day.
Flexible Backtesting for Python.
Similar tools
Python resources for trading simulation, backtesting, and ML
Backtest investment strategies in a few lines of Python
Vectorized Python backtesting and strategy research toolkit
Deep reinforcement learning library for automated quantitative trading
Python algorithmic trading framework with machine learning support