← All tools · Guides

How to choose a backtesting framework: nine open-source engines compared

Pick the market and the live-trading requirement first. Then the licence.

Short answer: there is no single best backtesting framework. backtrader still runs and is fine for learning, but it is not still maintained: the repository has been quiet for a long time, so do not base a new project on it. vectorbt is the maintained alternative when you want to test many parameter sets at once instead of walking one bar at a time. vnpy fits China futures or live orders, and Qlib fits machine-learning stock selection. Check the licence before you commit.

How to choose: name the market and whether the same code must send live orders, then read the licence and the maintenance column. Learning the idea usually starts with backtrader. China futures, or a live connection, points to vnpy. A sweep of many parameter sets points to vectorbt. Scoring stocks with a model points to Qlib.

Who it is for: someone who already writes a little Python and will install an open-source framework on their own computer, and needs a starting point for China A-share research, China futures, US stocks, or machine-learning stock selection.

Who it is not for: someone who wants a hosted website to provide the data and the compute, or who is choosing a broker terminal or a trading bot. Those are different jobs. This page compares local backtesting frameworks only.

The same nine-framework comparison in Chinese is how to choose a backtesting framework (Chinese). A shorter English note that only covers backtrader and four maintained alternatives is backtrader and maintained alternatives. That note is not this article. Broker terminals for China A-shares are how to choose a quant trading platform, and the QMT versus PTrade deep dive is how to choose between QMT and PTrade. Neither is an English alternate of this page.

This site has no commercial relationship with the projects below. Stars and maintenance status come from GitHub and refresh daily. The other facts were checked against each project README and its licence from 11 to 13 Oct 2026. Licences can change.

01 · Nine frameworks, one table

ToolWhat it isStyle and scopeLicenceGitHub starsMaintenance
backtraderLong-standing event-driven framework. Beginner tutorials often use it as the example. The repository has been quiet for a long timeEvent-driven; backtest and live tradingGPL-3.023.6kNo commits in over six months
vnpyPython quant trading platform that connects several broker and exchange interfaces. From version 4.0 it includes a multi-factor machine-learning moduleEvent-driven; backtest and live trading, including futures CTAMIT46.1kCommits today
rqalphaRicequant's open-source framework for backtests and simulated trading. It can be extended with ModsEvent-driven; backtest and simulated tradingNon-commercial use only6.8kLast commit 5 days ago
QlibMicrosoft's open-source AI quant platform. The emphasis is data processing and model training. Backtesting is one step in that workflowMachine-learning research workflowMIT49.7kLast commit 5 days ago
vectorbtPacks many parameter combinations into arrays and evaluates them together. Suited to large sweeps. Some features are in a paid PRO editionVectorized; backtest and strategy researchApache 2.0 with Commons Clause9.6kLast commit 4 days ago
zipline-reloadedCommunity-maintained continuation of Quantopian's zipline after that repository stopped updatingEvent-driven; backtestApache-2.02kCommits today
nautilus_traderRust core with strategies written in Python. Backtest and live trading share one codebaseEvent-driven; backtest and live tradingLGPL-3.030.9kCommits today
LeanQuantConnect's open-source engine. Modular design. Strategies can be written in Python or C#Event-driven; backtest and live tradingApache-2.022.3kCommits today
PyBrokerBacktesting framework aimed at machine-learning strategiesRules and models; backtestApache 2.0 with Commons Clause3.7kCommits today

Licence text was checked from 11 to 13 Oct 2026. The maintenance column is the live reading, not a promise that a quiet repository will stay quiet.

02 · Three differences that decide the shortlist

03 · backtrader: fine for learning, quiet as a project

backtrader is the event-driven library most beginner tutorials still use. It reads CSV files, online data, or pandas, and its README also describes live trading through Interactive Brokers and other connections. It is a reasonable first framework if the goal is to see how a backtest walks forward.

The repository has had no sustained updates for a long time. See the maintenance column above for the current reading. Python and pandas keep moving, and a break is yours to fix. Use it to learn the idea. For a project you expect to keep, pick a framework that is still maintained. The licence is GPL-3.0. A worked China A-share example is the first backtrader strategy. The same article in Chinese is the Chinese edition.

04 · China markets: vnpy and RQAlpha

vnpy (VeighNa) describes itself as a Python framework for building a quant trading system, with several trading gateways. Its README names private funds, brokers, and futures firms among users. Futures CTA is a primary use, and version 4.0 added vnpy.alpha for multi-factor machine-learning strategies. The licence is MIT, so commercial use is allowed on MIT terms. It is a whole trading platform. It is heavy if you only want to try one idea this afternoon.

RQAlpha is Ricequant's open-source framework for backtests and simulated trading. Strategies can be extended with Mods, and a strategy written here can also be run on Ricequant's hosted platform. The licence is the constraint: the README limits use to non-commercial work and says commercial use needs Ricequant's permission. Personal research is in scope. A company product is not, until you have asked.

05 · Machine learning: Qlib

Qlib is Microsoft's open-source AI quant platform. The work it is built for sits in front of the backtest: data, features, and model training. The backtest is one step in that pipeline. If the strategy is "score stocks with a model, then select," Qlib is the shorter path. If the strategy is a moving-average cross, Qlib is a detour. The licence is MIT. The install, community China A-share data, and a first Alpha158 + LightGBM run are in the Qlib walkthrough. The same article in Chinese is Qlib (Chinese).

06 · Parameter sweeps: vectorbt

vectorbt is vectorized. It does not run one strategy, then the next. It packs many parameter combinations into NumPy arrays and evaluates them together, with Numba for speed. That is the right shape for a parameter scan and for research.

Two limits before you adopt it. The licence is Apache 2.0 with a Commons Clause: you can use it without paying, and you cannot sell a product whose primary function is vectorbt. Some features live in a separate paid PRO edition.

07 · The other four

08 · How to choose, by job

Whichever you pick, a backtest is a reference, not a forecast. Leaving out fees and slippage, using data you would not have had at the time, or tuning until the history looks perfect will make the backtest kinder than a live account. After a backtest, paper trade. What that step has to show is on the beginner learning path. The walkthrough is paper trading after a backtest. The same article in Chinese is in Chinese.

The order around this choice, data first and an agent last, is how to choose AI quant tools. More engines are in the backtesting category. The wider job list is open-source tools by job.

Frequently asked questions

How to choose a backtesting framework?

Choose by market and by whether you need live orders, then by the licence and by whether anyone still maintains the project. There is no single best framework. backtrader is the usual first framework for learning the idea. vnpy fits China futures or a live connection. vectorbt fits a large parameter sweep. Qlib fits machine-learning stock selection.

Who it is for?

This guide is for someone who already writes a little Python and wants to install an open-source backtesting framework on their own computer. Use it to decide where to start for China A-share research, China futures, US stocks, or machine-learning stock selection.

Who it is not for?

This guide is not for someone who wants a hosted web platform to supply the data and the compute. It is not a comparison of broker terminals, and it is not a comparison of trading bots that send orders on their own. A backtesting framework checks a strategy. It does not open an account or replace a broker.

Is backtrader still a reasonable choice for a new project?

It is reasonable for learning how an event-driven backtest works. The repository has been quiet for a long time, so a compatibility break in Python or pandas is yours to fix. A project you expect to keep should start on a framework that is still maintained.

Can these frameworks be used in a commercial product?

Not all of them, and not on the same terms. vnpy and Qlib are MIT. zipline-reloaded and Lean are Apache-2.0. backtrader is GPL-3.0. NautilusTrader is LGPL-3.0. vectorbt and PyBroker are Apache 2.0 with a Commons Clause, so you can use them without paying but you cannot sell a product whose main feature is the library. RQAlpha's README limits use to non-commercial work. Read the project's own licence before you use one in a company.

This is not investment advice and not legal advice. Features and licences follow each project's own notice. A backtest is not a statement about future returns.