Alternative Assets & Financial Technology

Python Backtesting Libraries in 2026: What the Rankings Get Wrong

Key takeaway

Backtrader tops almost every 2026 ranking of Python backtesting libraries. Its last commit was in April 2023. Here is what the registries say about all six, and the licence question nobody mentions.

Published by AssetWhisper Editorial Desk
Laptop showing backtest code and results next to a ranking panel of Python backtesting libraries under a magnifying glass

Backtrader appears at or near the top of almost every list of Python backtesting libraries published this year. Its last commit to GitHub was on 19 April 2023. The two facts sit together comfortably because nobody checks: the rankings are copied from each other, and a library with 23,000 stars looks alive whether or not anyone is still maintaining it.

This article does the boring thing instead. Every number below was pulled from the package registry and the source repository on 17 September 2026, and anyone can re-run the same check in a minute. The conclusion is not the one the rankings give you, and the deciding factor turns out to be something they almost never mention: the licence.

The table

Library Stars Last commit Latest release Licence
Freqtrade 54,472 17 Sep 2026 2026.8 GPL-3.0
NautilusTrader 29,065 17 Sep 2026 1.231.0 LGPL-3.0
Backtrader 23,260 19 Apr 2023 1.9.78.123 GPL-3.0
VectorBT 9,110 2 Aug 2026 1.1.0 Custom, not OSI-standard
backtesting.py 8,968 5 Aug 2026 0.6.6 AGPL-3.0
Zipline-reloaded 1,938 13 Nov 2025 3.1.1 Apache-2.0
Stars, open issues and last commit from the GitHub API; versions and release dates from the PyPI JSON API. Both checked on 17 September 2026.

Three things jump out, and none of them appears in the usual comparison posts.

Backtrader’s last commit is dated April 2023 and its last release on PyPI is the same day. That is three years and five months of no changes, against a Python release cadence of roughly one version a year. It is not abandoned in the sense of being deleted — the code still installs and still runs — but nothing that has happened to Python, pandas or any exchange API since 2023 has been accounted for.

This does not make it useless. Backtrader’s event-driven design is still the clearest teaching model of how an order actually reaches a broker, and its documentation remains better than most of what replaced it. If you are learning how a backtest is structured, it is a reasonable place to start. If you are building something you intend to run against live data in 2027, you are adopting a dependency that nobody is going to patch for you.

The honest summary: excellent to read, risky to depend on.

2. The licence is the decision, not the speed

This is the part that gets left out, and it is the part that costs money.

Backtesting frameworks are mostly published under copyleft licences, and copyleft has consequences that only appear when you try to turn your strategy into a product:

  • AGPL-3.0 — backtesting.py. The AGPL extends the obligation to software offered over a network. If you build a web service on top of it and let other people use it, the licence asks you to make your source available to those users. For a personal backtest this is irrelevant; for a subscription product it is the whole ball game.
  • GPL-3.0 — Backtrader and Freqtrade. Distributing a derived work means distributing the source. Running it privately for your own trading does not trigger anything.
  • LGPL-3.0 — NautilusTrader. Materially more permissive when the library is used as a library rather than modified.
  • Apache-2.0 — Zipline-reloaded. The most business-friendly of the set, with an express patent grant.
  • Non-standard — VectorBT. GitHub cannot classify its licence file, which is a flag worth taking seriously: an unclassified licence is one your own lawyer has to read rather than recognise.

Ordered by “can I build a commercial product on this without a conversation”, the ranking inverts almost completely: Apache first, then LGPL, then the GPL pair, then AGPL, with the custom licence in a category of its own. Not one of the popularity rankings mentions this.

3. The two most active projects are not backtesters

Freqtrade and NautilusTrader both had commits on the day this was written. They are also the two largest by stars. But neither is a backtesting library in the sense that Backtrader is: they are trading systems that include a backtester.

That difference matters more than it sounds. A backtester answers “would this rule have worked”. A trading system also has to answer “how do I hold state across a restart”, “what happens when the exchange rejects the order” and “who pages me at 3am”. If what you want is to test an idea over ten years of daily bars, adopting one of these means carrying a great deal of machinery you will not use.

What each one is actually for

If you want to… Use Because
Learn how a backtest is built Backtrader Clearest event-driven model and the best docs; accept that it is frozen
Sweep thousands of parameter sets VectorBT Vectorised over arrays, orders of magnitude faster for grids; read the licence first
Run research with a data pipeline Zipline-reloaded Bundles and the Pipeline API; Apache licence; slower cadence but alive
Trade crypto live Freqtrade Most active project of the six, exchange integrations included
Build low-latency infrastructure NautilusTrader Rust core, event-driven, LGPL
Test one idea this afternoon backtesting.py Smallest surface area of the six; AGPL makes it a poor base for a product

How to check this yourself

The point of this article is not the table; it is that the table goes stale and you should not have to trust it. Both registries expose the numbers without authentication:

  • Release and version: https://pypi.org/pypi/<package>/json returns the current version and its upload date.
  • Activity and licence: https://api.github.com/repos/<owner>/<repo> for stars and licence, and /commits?per_page=1 for the date of the most recent commit.

Two minutes, no account. Do it before adopting any dependency you intend to run with money behind it, and do it again a year later.

The thing the library will not save you from

Choosing well matters less than most people writing about it suggest. None of these six protects you from the errors that make a backtest lie: look-ahead bias, survivorship in the price series, costs modelled optimistically, or a parameter grid searched until something looked good. A faster library only lets you overfit sooner.

That is the more useful thing to get right, and it is where the sizing question lives too — a strategy with a genuine edge still ruins an account if the position size is wrong, which is the arithmetic behind why nobody runs full Kelly and behind position sizing and risk of ruin. For the strategy layer above the tooling, see our guide to algorithmic trading strategies.

What a live trading bot needs besides the library

Most searches for “the best Python library for a trading bot” assume the library is the bot. It is one layer of four, and the other three are where live accounts actually get hurt.

  • A broker or exchange API. Something has to send the order. For US equities, Alpaca’s official client is alpaca-py (Apache-2.0, version 0.44.0 released 11 August 2026). For Interactive Brokers, the widely used ib_insync wrapper is archived on GitHub, with its last commit on 14 March 2024; the maintained continuation is ib_async (BSD-2-Clause, version 2.1.0 released 8 December 2025). For crypto exchanges, ccxt (MIT) is the common layer, and Freqtrade already builds on it.
  • Data you can trust at the moment of the trade. Free adjusted daily prices are adequate for research and inadequate for execution. A backtest on one feed and live orders on another is a silent source of divergence; our evidence review of algorithmic trading strategies covers what a retail data stack looks like and where it breaks.
  • Risk rules that do not depend on the strategy being right. A maximum size per position, a maximum daily loss, and a switch that stops the bot when either is hit. How large each position should be is not a coding question; it is the arithmetic of position sizing and risk of ruin, and it decides whether a real edge survives a bad run.
  • Operations. State that survives a restart, handling for rejected and partially filled orders, logs, and an alert when something stops. This is the machinery Freqtrade and NautilusTrader include and the pure backtesters do not.

The practical consequence: choose the backtesting library for the research you need to do, and choose the broker API for the market you intend to trade — they are separate decisions, and the second one limits the first more often than the reverse. Our complete guide to algorithmic trading in 2026 walks through the full system, from strategy to execution, and before any real order, run the whole chain in paper trading: Freqtrade starts in dry-run mode by default, and Alpaca offers a free paper-only account.

In short

Backtrader leads the 2026 rankings and has not been touched since April 2023. Freqtrade and NautilusTrader are the live projects, but they are trading systems rather than backtesters. Zipline-reloaded is the only one of the six under a permissive licence, and backtesting.py is AGPL, which decides the question for anyone planning to charge for what they build. Pick for the job and the licence, verify the dates yourself, and remember that the library is not what makes a backtest honest.

Frequently asked questions

What is the best Python library for a trading bot in 2026?
It depends on what the bot trades, because a backtesting library on its own is not a bot. For crypto, Freqtrade is a complete system with exchange integrations and a simulated dry-run mode, and it was the most active project in our comparison (release 2026.8 on 31 August 2026). If you need a deterministic, event-driven engine with a Rust core, NautilusTrader is the other live-capable framework. Backtrader, VectorBT and backtesting.py test strategies; to trade live they need a broker API such as alpaca-py, ib_async or ccxt. Checked 25 September 2026.

What is the difference between a backtesting library and a live trading framework?
A backtesting library answers whether a rule would have worked on past data. A live trading framework also has to place orders, keep state across restarts, handle rejections and partial fills, and alert you when something breaks. Freqtrade and NautilusTrader are trading systems that include a backtester; Backtrader, VectorBT, backtesting.py and Zipline-reloaded are primarily research tools.

Is Backtrader still maintained?
Not actively. As of 25 September 2026, the last commit to its GitHub repository was on 19 April 2023, and its latest PyPI release, 1.9.78.123, is from the same day. The repository is not archived and the package still installs, so it remains a good way to learn how an event-driven backtest works, but nothing released since 2023 in Python, pandas or broker APIs has been accounted for.

Should I use VectorBT or backtesting.py?
VectorBT if you need to test thousands of parameter combinations, because it works on whole arrays at once; backtesting.py if you want to test one idea quickly with the smallest amount of code. The licence matters more than the speed if you plan to sell anything: VectorBT is Apache 2.0 with a Commons Clause that withholds the right to sell a product whose value derives substantially from it, and backtesting.py is AGPL-3.0, which extends source-sharing obligations to software offered over a network. Both were active as of 25 September 2026: VectorBT’s last commit was on 17 September 2026, after the table above was compiled, and backtesting.py’s on 5 August 2026.

Can I build a trading bot in Python for free?
The software, yes: all six libraries in this comparison are free to use, and you can run the full chain without money at risk — Freqtrade’s dry-run mode is on by default, and Alpaca’s paper-only account is free and open to anyone with an email address. Trading live is never free. Commissions, spreads, data and hosting all cost something, and for a strategy with a thin edge they are often the difference between profit and loss.

Which Python version should I use for a trading bot in 2026?
Check what your framework declares on PyPI rather than assuming. As of 25 September 2026, NautilusTrader requires Python 3.12 to 3.14, VectorBT 3.11 to 3.14, Freqtrade 3.11 or later, Zipline-reloaded 3.10 or later and backtesting.py 3.9 or later. Backtrader declares no requirement at all, which, for a package last released in 2023, means nobody has confirmed it on recent versions.

Sources

  • GitHub REST API, /repos/<owner>/<repo> and /commits?per_page=1, for stars, licence, archive status and last commit: Backtrader, VectorBT (licence text: Apache 2.0 with Commons Clause), backtesting.py, Freqtrade, NautilusTrader, Zipline-reloaded, ib_insync, ib_async, alpaca-py, ccxt. Table checked 17 September 2026; FAQ and broker-API figures checked 25 September 2026.
  • PyPI JSON API, https://pypi.org/pypi/<package>/json, for latest versions, release dates and declared Python versions. Checked on the same dates.
  • Freqtrade documentation, Configuration: dry_run defaults to true, and in dry-run orders are simulated and not posted to the exchange.
  • Alpaca documentation, Paper Trading: the paper environment is free, and a paper-only account needs only an email address. Checked 25 September 2026.

Figures verified against the PyPI and GitHub APIs on 17 September 2026 and valid as of that date; the FAQ and the broker-API details were re-checked on 25 September 2026. Educational content only; not investment advice. AssetWhisper does not publish trading signals.

Join the discussion

Your email address will not be published. Required fields are marked *