Backtrader vs vectorbt: an order simulator against a parameter sweep
One loops bar by bar and models how orders fill; the other runs a thousand variants at once. One is frozen since 2023; the licences point opposite ways.
An event-driven Python backtester with 122 indicators, frozen since April 2023.
Vectorised backtesting — thousands of parameter combinations in one NumPy pass.
The two libraries answer different questions about the same strategy, and most people who are stuck between them have not yet decided which question they are asking. "Which of these 2,000 parameter sets is worth a second look" is a vectorbt question. "What happens to this position if the stop and the target are both inside tomorrow's range" is a backtrader question. After that, two facts neither card can put next to the other do the rest: one of these is maintained and one is not, and the licences restrict opposite things.
What each engine can express
Backtrader is event-driven. A Cerebro engine walks the bars one at a time and
calls your strategy's next(), filling orders through a simulated broker that knows limit, stop,
stop-limit and trailing-stop orders, bracket and OCO groups, percentage or fixed
slippage, fills capped at a share of the bar's volume, and commission schemes
with an interest charge for carrying a short or leveraged position. That is the reason it still
has users: a strategy whose result depends on how an order fills is expressible in it.
vectorbt broadcasts. A strategy is a pair of boolean signal arrays; a thousand
parameter combinations are a thousand columns, and one Portfolio.from_signals call simulates all
of them through compiled kernels in one pass. The price is precision inside the
bar. Fills are at bar prices, and stops are checked against the bar's open, high and low — which,
if you pass only closing prices, the library fills in as the close and the larger and smaller of
open and close. A stop tested that way never sees a wick. Pass the real high and low, and treat
intrabar ordering as an approximation either way.
One of them is still being released
vectorbt is moving: 1.0.0 on 22 April 2026 with an optional Rust backend, 1.1.0 on 5 July 2026 for Python 3.14, pandas 3 and NumPy 2.4, and 1.1.1 on PyPI on 26 September 2026. The cost of that is a demanding floor — Python 3.11 to 3.14, NumPy 2.4 and pandas 3 or newer — and an older stack stops at 1.0.0, the last release that still takes Python 3.10 and pandas 2.
backtrader's last release, 1.9.78.123, is dated 19 April 2023, the same day as its last commit. Sixty-three pull requests sit open, issues are switched off, and the package declares neither a Python version nor a required dependency, so pip installs it into any interpreter without complaint and leaves the incompatibilities for you to find. The community fork people point to, backtrader2, is staler than the original; the one shipping releases in 2026 is backtrader_next, a small alpha package that is not a drop-in for code importing the original name.
Choosing backtrader in 2026 means choosing to pin an environment and patch it yourself.
The licences restrict opposite things
This is the part neither card can say alone. vectorbt is Apache 2.0 with the Commons Clause, which withholds only the right to Sell: to provide third parties, for a fee, a product or service whose value derives substantially from the software, hosting and support fees included. It is not OSI open source.
backtrader is GPL-3.0-or-later. The GPL permits charging for software, and running a program on your own server is not distribution under it — that is the gap the separate AGPL was written to close. What the GPL does restrict is handing the program to others: ship backtrader inside something you distribute and the whole of it comes under the GPL's source terms.
So for a firm trading its own capital, both are fine. For a hosted backtesting service that charges its users, the GPL library is the one whose licence allows it, and vectorbt needs a written agreement with its author.
Live trading is a second system from either
vectorbt has no broker connection, no order routing and no paper account. backtrader's live stores are older than its freeze: Interactive Brokers through IbPy, archived in January 2017, and Oanda through the v1 REST API Oanda has retired. A backtrader strategy that looks one import away from live is several dependencies away from it.
The recommendation
vectorbt, as long as the question is which signals and which parameters, on a current Python — which is most research. Backtrader only when the result genuinely depends on order mechanics inside the bar, such as brackets, OCO exits or volume-capped fills, and you accept pinning a frozen library; and the moment that same code has to place real orders, neither — NautilusTrader is the maintained event-driven engine with live venues. If you intend to charge others for a hosted service built on the engine, check the licence before the benchmark: backtrader's permits it, vectorbt's needs the author's agreement.
The rest of the category is on the backtesting frameworks page.
FAQ
Is backtrader or vectorbt faster?
vectorbt, by design. It simulates every parameter combination as a column of one NumPy array through compiled kernels, where backtrader calls a Python next() method once per bar per strategy instance. The gap is widest on grid searches over many symbols, which is exactly where people leave backtrader.
Can I sell a hosted backtesting service built on either one?
The licences answer this in opposite directions. vectorbt's Commons Clause withholds the right to provide third parties, for a fee, a product or service whose value derives substantially from vectorbt, hosting included, so that needs a written agreement with the author. backtrader is GPL-3.0-or-later, which permits charging for it and does not treat running it on your own server as distribution. Handing the program itself to others is distribution, and brings the GPL's source obligations.
Will backtrader still install on a current Python?
It will install on anything, because its package declares no Python requirement and no required dependencies. Whether it runs is yours to find out; its classifiers stop at Python 3.7, and a May 2026 pull request fixing a Python 3.10+ deprecation is still unmerged. vectorbt 1.1 declares the opposite and requires Python 3.11 to 3.14, NumPy 2.4 and pandas 3.
Can either one place live trades?
vectorbt cannot; it has no broker connection at all. backtrader ships stores for Interactive Brokers, Oanda and VisualChart, but the IB store depends on IbPy, archived since January 2017, and the Oanda store speaks the v1 API Oanda retired. In practice live trading from either means a second system.