Markets and trading · Edition No. 27 · 21 Sep 2026

pmorissette/bt

Backtesting built from reusable blocks, with strategies that can contain other strategies.

← Markets and tradingRead the whole edition →
11

pmorissette/bt

💎 hidden gem

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.

Stars2,982
LicenceMIT
Latestv1.2.3 (2026-09-11) per ungh.cc/repos/pmorissette/bt/releases/latest; that release moved the core onto numpy arrays for speed
Good
  • 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.
Watch for
  • 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.
Similar repositories
Install
python3 -m venv venv
source venv/bin/activate
pip install bt
Screenshots
pmorissette/bt: GitHub preview card

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.