2,982 stars · MIT · v1.2.3 (2026-09-11) per ungh.cc/repos/pmorissette/bt/releases/latest; that release moved the core onto numpy arrays for speed · Track this in Scout
Backtesting built from reusable blocks, with strategies that can contain other strategies.
▶Repo detailsthe review · specs · pros & cons · install
What it is
A Python framework built on ffn, its author's library of financial statistics. A strategy is a stack of small algorithms run in order on each date, and strategies compose into a tree, so a portfolio of strategies is tested exactly like a single one.
What it is good for. The point at which one rule becomes several. Testing a single rule is easy and most libraries do it; the hard question is how three rules behave together, how to divide money between them, and how often to rebalance. That is the question this is shaped around, and it is why the tree matters. It also suits anyone who wants to try many variations, because changing a strategy means swapping one block rather than rewriting a loop.
- MIT, and it is genuinely open, which not every backtesting library on this radar can say.
- The block structure makes variations cheap, so comparing twenty versions of an idea is an afternoon rather than a week.
- Its newest release, v1.2.3, is dated 11 September 2026, and it included a rewrite of the core onto numpy arrays for speed. It is actively maintained.
- It works on end-of-day prices and portfolio weights. It does not model the order queue, latency or the spread, so it is the wrong tool for anything fast.
- It has many dependencies, and on Windows the project itself recommends installing a scientific Python distribution first.
- A backtest is not a result. Any framework this flexible makes it easy to test an idea a hundred ways and keep the one that looked best by luck.
kernc/backtesting.pyIt tests a single strategy on one instrument with an interactive chart, and it is also AGPL-3.0 rather than MIT.
Track this in Scout
edtechre/pybrokerIt is aimed at machine-learning strategies, and its licence carries the Commons Clause, so it is not open source.
Track this in Scout
pmorissette/ffnBy the same author, it is the statistics library underneath this one, and on its own it measures and compares returns rather than running a strategy.
Track this in Scout
python3 -m venv venv source venv/bin/activate pip install bt
