Backtesting libraries · Inactive

Backtrader

Event-driven Python backtesting and live-trading library with a large community.

GitHub stars23.7k
Forks5.3k
Last commit2024-08-19
LicenseGPL-3.0
LanguagePython
StatusInactive

GitHub statistics as of 2026-11-10. Status: active = commits in the last 90 days, slowing = in the last year, inactive = older, archived = read-only.

Overview

Backtrader runs a strategy bar by bar, the way it would trade live, with brokers, sizers, analyzers and more than a hundred built-in indicators. It became the default choice for Python backtesting in the late 2010s, and a lot of tutorials and Stack Overflow answers still use it. It has seen very little development in recent years (see the last-commit date above), but the code is stable.

Best for: Learning backtesting, strategies with complex order logic, and porting rule-based systems such as MT4/MT5 Expert Advisors.

Strengths

  • Realistic event-driven simulation: orders, stops, partial fills, commissions
  • Huge amount of examples and community answers
  • Multiple data feeds and timeframes in one strategy

Limitations

  • Slow for large parameter sweeps compared with vectorized libraries
  • No longer actively developed; plotting can break with newer Matplotlib
  • Live-trading brokers are dated

From our own use

Quant Arena's EA Arena runs on Backtrader: 1,063 Expert Advisors converted from MQL5 are re-run every month on four markets of hourly data, about one second per run.

Comparisons

Alternatives in Backtesting libraries

All frameworks · Descriptions are our own summary and may lag behind each project's documentation. Check the project's license before using it in a product. Nothing here is investment advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.