AllTradingTools Suggest a Tool

Backtrader

backtrader.com

Free, open-source Python library for backtesting and live trading, widely used and well documented, though largely inactive since 2023.

What it is

Backtrader is a Python framework for testing trading strategies on historical data and, optionally, running them live. You write a strategy class with your entry and exit rules, add data feeds and analyzers, and Backtrader handles the event loop, order simulation, commissions, position sizing and plotting. It is a library rather than an application: there is no user interface beyond the charts it draws, and everything is set up in code.

Its feature set is broad for a free tool. It reads CSV files, pandas DataFrames and several online sources; resamples and replays data across timeframes; rolls over futures contracts; supports bracket, OCO, stop-trail and target orders; ships with a large indicator library plus TA-Lib support; and includes performance analyzers with PyFolio integration. Live trading connectors exist for Interactive Brokers, Oanda (v1 API) and Visual Chart.

Know its status before building on it. The code is GPL-3.0 licensed and free, but the last PyPI release (1.9.78.123) dates from April 2023 and the last push to the main GitHub repository from August 2024. The official forum was closed because of abuse, so help comes from the documentation, Stack Overflow and community forks. The Oanda connector targets the old v1 API and the Interactive Brokers connector depends on the older IbPy package.

Key features

Event-driven backtesting
Strategies are Python classes; Backtrader simulates orders, fills and commissions bar by bar across one or many data feeds.
Data handling
Loads CSV, pandas and online feeds, and can resample, replay and mix timeframes, including futures rollover.
Indicators and TA-Lib
A large built-in indicator library with optional TA-Lib integration, and indicators can be combined across timeframes.
Analyzers
Built-in performance analyzers and position and trade tracking, with PyFolio integration.
Order types and sizing
Bracket, OCO, target and trailing-stop orders, with custom sizers and commission schemes.
Live trading
Broker connectors for Interactive Brokers, Oanda (v1 REST API) and Visual Chart.
Plotting
Matplotlib charts of prices, indicators, trades and portfolio value, with date-range filtering.

Pricing

PlanPriceWhat you get
Open source$0Full library under the GPL-3.0 license, installed with pip

There is no paid version or hosted service. Market data is not included; you supply your own.

Free option: Everything is free and open source under GPL-3.0. You provide your own Python environment and market data.

Checked September 25, 2026 on github.com. Prices change; confirm on the provider's site before you subscribe.

Strengths

  • Completely free, with no usage limits or paid tiers
  • Extensive documentation and many examples from years of wide use
  • Flexible data handling: multiple feeds, resampling, replay and futures rollover
  • Realistic order types and commission modeling for a free tool

Limitations

  • The last release was in April 2023 and the main repository has not been updated since August 2024
  • The official community forum is closed, so support relies on documentation, Stack Overflow and forks
  • Requires Python programming; there is no visual strategy builder
  • Live broker connectors are limited to Interactive Brokers, Oanda v1 and Visual Chart and rely on older client libraries
  • No market data is included

Good fit for

  • Python developers who want full control over backtest logic
  • Traders learning how event-driven backtesting works
  • Researchers testing multi-timeframe or futures strategies on their own data

Look elsewhere if

  • Traders who want a point-and-click backtester
  • Teams that need an actively maintained library with vendor support

Compare

Alternatives to Backtrader

All backtesting & algo tools

Backtrader questions

Is Backtrader free?

Yes. It is open source under the GPL-3.0 license and has no paid version.

Is Backtrader still maintained?

Activity is low. The latest PyPI release, 1.9.78.123, came out in April 2023 and the main GitHub repository was last pushed in August 2024.

Which brokers can Backtrader trade live with?

Interactive Brokers, Oanda (through its v1 REST API) and Visual Chart, each through its own connector.

Does Backtrader come with market data?

No. You load your own data from CSV files, pandas DataFrames or supported online feeds.

Written from Backtrader's own website and documentation. All Trading Tools lists and compares tools; it does not recommend trades or give financial advice. Sources: backtrader.com, github.com/mementum/backtrader, pypi.org/project/backtrader, api.github.com/repos/mementum/backtrader.

Esc