# pmorissette/bt

bt - flexible backtesting for Python

Repository: https://github.com/pmorissette/bt
Canonical: https://ross.abutalabs.com/products/bt
Homepage: http://pmorissette.github.io/bt
Language: Python
License: MIT
License Family: permissive
Last push: 2026-08-07T03:38:56+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 81, longevity 100
- inputs: {"age_days": 4458, "days_push": 26, "days_rel": 130, "gap_med": 29, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2966, forks 493 (observed 2026-08-28T04:07:32.551313+00:00)

## What it is
bt is a flexible Python backtesting framework for testing quantitative trading strategies. It uses composable Algos and AlgoStacks with a tree structure to build modular, reusable strategy logic, and provides charting and detailed performance statistics.

## Use cases
- backtest a quantitative trading strategy in python
- test a monthly rebalanced portfolio strategy on historical data
- compare performance statistics across multiple backtests
- build modular reusable trading strategy logic
- visualize backtest results with charts
- simulate long-only equal-weight allocation strategies

## When to choose
- you are a quant developing and testing trading strategies in Python
- you want composable, reusable strategy logic blocks instead of monolithic backtest scripts
- you want built-in stats and charting for backtest comparison
- you want to leverage the Python data ecosystem (pandas, ffn) in your strategies

## When to avoid
- you need live trading or broker execution - bt is backtesting only
- you need high-frequency or tick-level backtesting performance
- you need a production-stable release - bt is self-described as alpha stage
- you are not working in Python

## Facets
- artifact type: framework
- maturity: active
- function: simulation, data-visualization, benchmarking
- domain: fintech, data-science
- platform: python, cross-platform
- tags: backtesting, quantitative-finance, algorithmic-trading, trading-strategies, finance, algorithms

## Member repositories
- pmorissette/bt (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:32.551313+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:32:02.001300+00:00, confidence not recorded.
  - readme: https://github.com/pmorissette/bt (fetched 2026-08-28T04:07:32.551313+00:00, sha 32f73feefbcf)
  - homepage: http://pmorissette.github.io/bt (fetched 2026-08-29T09:47:14.060372+00:00, sha 24e7b43e063e)
  - registry_pypi: https://pypi.org/pypi/bt/json (fetched 2026-08-29T09:47:14.069854+00:00, sha a5e917ce18cc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
