# Backtrader

An event-driven Python backtester with 122 indicators, frozen since April 2023.

*https://stockmarketstack.com/tools/backtrader · Backtesting Frameworks & Algo Trading Libraries*

## Facts

### At a glance

| Field | Value |
| --- | --- |
| Vendor | Daniel Rodriguez |
| Category | Backtesting Frameworks & Algo Trading Libraries |
| Job | backtesting |
| Website | https://www.backtrader.com |
| Pricing model | open-source |
| Free tier | true |
| Open source | true |
| Licence | GPL-3.0-or-later |
| Self-hosted | true |
| Tested hands-on | false |
| Last updated | 2026-09-14 |

### Coverage

| Field | Value |
| --- | --- |
| Asset classes | stocks, etf, futures, forex, indices |
| Markets | global |
| Works outside the US | true |
| Data latency | none |
| Platforms | library, cli |
| AI features | none |

### Interfaces

| Field | Value |
| --- | --- |
| API | false |
| Webhooks | false |
| Scripting | Python |
| Python | true |
| Spreadsheet add-in | false |
| MCP server | false |
| Export | csv |

### Capabilities

Yes: backtesting, automation, live_trading, paper_trading

No: charting, screening, scanning, portfolio_tracking, broker_import, tax_reporting, alerts, news, options_analysis

*Verified: pricing 2026-09-13; capabilities 2026-09-14; coverage 2026-09-14.*

## What it is

Backtrader is an event-driven backtesting framework for Python. You subclass `bt.Strategy`,
hand data feeds and indicators to a `Cerebro` engine, and it walks the bars one at a time
calling `next()`, filling orders through a simulated broker. Event-driven rather than
vectorised is the design decision that defines it: it costs speed and buys order semantics a
vectorised engine cannot express — limit, stop, stop-limit, trailing stop, OCO and bracket
orders, slippage models, volume-based filling, and continuous cash adjustment for futures-like
instruments. 122 indicators ship with it, TA-Lib plugs in, and the documentation is unusually
complete for a project of this size.

It is also frozen. Last commit to master and last PyPI release are both version 1.9.78.123,
dated 19 April 2023. The repository is not archived, GitHub issues are turned off, and 63 pull
requests are open — the newest from July 2026, one of them a May 2026 fix for a Python 3.10+
deprecation that is still unmerged. `setup.py` declares neither `python_requires` nor a single
dependency, so pip drops it into any interpreter without a word of complaint; the package's own
classifiers stop at Python 3.7. The community forum the README names as the support channel in
place of issues returned a 522 on every attempt on 14 September 2026.

What the simulated broker models is unusually complete for a free library: percentage or fixed
slippage with separate switches for whether opening prices and limit orders slip, volume fillers
that cap a fill at a share of the bar's volume, commission schemes that charge a percentage or a
fixed amount per contract and can add a yearly interest rate for holding a short or a leveraged
position, and a cheat-on-open mode for strategies that size off the opening print. Fifteen
analyzers — Sharpe, SQN, VWR, Calmar, drawdown, time return, transactions, a trade breakdown —
turn a run into statistics without a second library, and `optstrategy` spreads a parameter grid
across processes.

## Data & coverage

None of its own. Built-in feeds read CSV files, pandas DataFrames, Yahoo, and the live stores;
everything else is a feed you write or install. Resampling, replay and multi-timeframe are
built in, as are trading calendars for non-US sessions, so the framework is market-agnostic and
the coverage is whatever you pay someone else for.

## Integrations

Live data and trading through Interactive Brokers (IbPy), VisualChart and Oanda v1. Plotting is
matplotlib. `pip install backtrader` pulls no dependencies at all unless you ask for plotting,
and a `btrun` command-line runner is installed alongside the library.

## Limitations

- Unmaintained since April 2023. Every Python, numpy or matplotlib incompatibility from here is
  yours to patch or pin around.
- The Oanda store targets an API Oanda retired, and the IB store needs IbPy, archived since
  January 2017; pyfolio integration is marked deprecated in the project's own README.
- Event-driven means slow. Sweeping a parameter grid over a large universe is where people leave
  for a vectorised engine.
- No options modelling — no chains, no greeks, no expiry handling. An `Options support` pull
  request has been open since September 2025.
- GPL-3.0-or-later. Embedding it in a closed-source product is a licensing decision, not a free
  one.

## Alternatives

[Backtesting.py](https://stockmarketstack.com/tools/backtesting-py) and [VectorBT](https://stockmarketstack.com/tools/vectorbt) for speed on parameter
sweeps, [NautilusTrader](https://stockmarketstack.com/tools/nautilus-trader) and [QuantConnect](https://stockmarketstack.com/tools/quantconnect) LEAN for
a maintained event-driven engine with live brokers, [Zipline-reloaded](https://stockmarketstack.com/tools/zipline-reloaded)
for the pipeline API.
Within the backtrader family itself, backtrader_next is the fork with 2026 releases.

The rest are in the [backtesting frameworks category](https://stockmarketstack.com/categories/backtesting-frameworks).

## FAQ

### Is backtrader still maintained?

No. The last commit to master and the last PyPI release are both 1.9.78.123 on 19 April 2023, and the last merged pull request is from the same day. The repository is not archived and 63 pull requests sit open, the newest filed in July 2026 — including one from May 2026 fixing a Python 3.10+ deprecation. Nothing is being merged.

### Has the backtrader2 community fork taken over?

No, and this is the most common misreading. The backtrader2 organisation forked the project to keep it alive, but its last commit is from November 2021 and its PyPI package stopped at 1.9.76.123 in July 2020 — two point releases behind the original. The fork is staler than the thing it forked.

### Which fork is actually being released in 2026?

backtrader_next, published on PyPI as backtrader-next, shipped 2.3.7 on 26 March 2026 and requires Python 3.11 or newer. It is small — under 100 stars, classified alpha — so it is a live fork rather than an anointed successor. It is not a drop-in for code pinned to the original package name.

### Can backtrader place real orders?

Yes, through three built-in stores — Interactive Brokers via IbPy, VisualChart via a forked comtypes, and Oanda. Each rests on a dependency that stopped moving — IbPy was archived in January 2017. The Oanda store speaks the retired v1 REST API — the README says v20 did not support streaming when it was implemented — so a working Oanda setup today means a third-party v20 package, not the shipped store.

## Also worth comparing

- [Backtesting.py](https://stockmarketstack.com/tools/backtesting-py.md) — A single-instrument Python backtester — one OHLC series, one strategy, no live trading.
- [bt](https://stockmarketstack.com/tools/bt.md) — Python backtesting for allocation and rebalancing rules, not entries and exits.
- [fastquant](https://stockmarketstack.com/tools/fastquant.md) — A one-call wrapper over Backtrader, dormant since 2023 and broken on PyPI.
- [QSTrader](https://stockmarketstack.com/tools/qstrader.md) — An institutional-shaped Python backtester whose last commit to master was June 2024.
- [Zipline-reloaded](https://stockmarketstack.com/tools/zipline-reloaded.md) — The maintained fork of Quantopian's Zipline. Bring your own data — it ships almost none.
- [AmiBroker](https://stockmarketstack.com/tools/amibroker.md) — Windows portfolio backtester scripted in AFL, sold as a perpetual licence.
