Read time … min

Run Backtrader on TradingHost

Run open-source Backtrader strategies from GitHub on always-on TradingHost runtimes.

Backtrader is a Python backtesting library with 122 built-in indicators, multi-data support, and live broker integrations to Interactive Brokers, Oanda, and Visual Chart. TradingHost gives that strategy a production runtime.

By the TradingHost engineering team
  • GitHub-native deployment
  • 122 built-in indicators
  • Multi-data, multi-timeframe
  • Step or full backtest execution
  • Live brokers: IBKR, Oanda, Visual Chart
  • Always-on runtime
  • Encrypted credentials
  • Region selection
  • MCP-ready

Introduction

New to Backtrader?

Backtrader is one of the most well-known Python backtesting libraries. It is a full event-driven engine: you define a Strategy class with next() called once per bar, drop in any of 122 built-in indicators, attach one or more data feeds, and run either a step-by-step or a full backtest pass.

Beyond backtesting, Backtrader supports live trading against Interactive Brokers (via IbPy), Oanda v20 REST, and Visual Chart, which is why it remains a popular choice for equities, futures, and FX strategies that need a single codebase across research and live.

Maintenance reality: the original mementum/backtrader repository has been quiet since 2023. The community fork at backtrader2/backtrader continues with bugfix maintenance. Backtrader is GPL-3.0 licensed; both the original and the fork are freely usable. TradingHost runs whichever copy you point us at.

TradingHost is where a Backtrader strategy runs in production. Instead of leaving your strategy on a laptop or a generic VPS, you deploy your Backtrader repo to a TradingHost cloud runtime that stays online, manages your broker credentials as encrypted secrets, and streams logs back to you.

Section 01 · At a glance

At a glance

What Backtrader is
Open-source Python backtesting library with live trading hooks, GPL-3.0 licensed
Maintained by
mementum/backtrader on GitHub (community fork: backtrader2/backtrader)
Maintenance status
Original repo quiet since 2023; backtrader2 community fork continues bugfix maintenance
Language
Python, including PyPy
Indicators
122 built-in technical indicators
Data feeds
CSV, pandas DataFrame, Yahoo, IBKR, Oanda, Visual Chart, custom
Live brokers
Interactive Brokers (IbPy), Oanda v20 REST, Visual Chart
Markets
Equities, futures, options, FX, crypto (via custom feeds)
Notable features
Multi-data, multi-timeframe, resampling and replaying, step-by-step or full execution, optimisation
Deployment source
GitHub
TradingHost role
Runtime, deployment, logs, secrets, region selection
Affiliation
TradingHost is independent and is not affiliated with the Backtrader project

Section 02 · Where Backtrader fits

How Backtrader fits into the trading stack

Backtrader is a research engine first and a live trading harness second. Its event-driven loop is the same in both modes, which is why a Strategy class developed for backtesting can usually be promoted to live with config changes rather than a rewrite.

You can use Backtrader two ways on TradingHost:

  • Path 01

    Research-only

    Run backtests, optimise parameters, and visualise results. Use any data feed, including CSV files committed to your repo, pandas DataFrames, or pulled from a broker feed. No live credentials needed.

  • Path 02

    Backtest then live

    Reuse the same Strategy class against a live broker. Backtrader includes integrations for Interactive Brokers (via IbPy), Oanda v20 REST, and Visual Chart. The runtime stays online so the live loop keeps trading.

Either path runs the same way on TradingHost. You bring a Backtrader GitHub repo. We run it.

You
Your Strategy class owns the trading rules.
Backtrader
Runs the backtester, optimiser, indicator engine, and broker integrations.
Broker
Your broker account receives the orders.
TradingHost
Runs the strategy process, manages secrets, streams logs.

Section 03 · Why on TradingHost

Why deploy Backtrader on TradingHost

Backtrader has two production needs that don’t fit neatly on a laptop. Live strategies want a runtime that stays online and reconnects to the broker after network blips. Research workloads want a host with enough compute to chew through long historical ranges or large optimisation grids without monopolising your workstation.

TradingHost gives both shapes a production-oriented runtime designed for long-running trading and research processes.

What you get

  • GitHub-native deployment
  • Always-on container runtime for live strategies
  • Compute-friendly host for long backtests and optimisation runs
  • Encrypted broker credential storage
  • Region selection close to your broker
  • Streaming logs and basic health
  • Strategy-level start, stop, restart, inspect
  • Pin to mementum/backtrader or backtrader2/backtrader as you prefer
  • MCP-compatible AI IDE workflows

What you keep

  • Full control over your Backtrader Strategy code and indicators
  • Direct ownership of your broker accounts and credentials
  • Your choice of mode: research, optimisation, or live

Section 04 · Live brokers and data feeds

Live brokers and data feeds

Unlike the crypto-first frameworks, Backtrader is broker-led. The same Strategy class can run against three live broker integrations and a wider set of historical data feeds.

  • Backtrader
  • your broker or feed
  • TradingHost runtime

Backtrader also supports a wide variety of data feeds for backtesting and research:

  • CSV files committed to your repo
  • pandas DataFrames built in-process
  • Yahoo Finance feed
  • Custom Python data feeds you author
  • Live broker feeds (IBKR, Oanda, Visual Chart)
Browse the broker directory

Section 05 · Deployment flow

How a Backtrader deployment works

A Backtrader strategy on TradingHost follows the same deployment pattern as any GitHub-based project, with one extra step for choosing which Backtrader copy to run.

  1. STEP 01

    Connect or create a repo

    Sign in with GitHub and connect an existing Backtrader repo (your Strategy class, indicators, and data feeds), or create one from a TradingHost Backtrader template.

  2. STEP 02

    Pin the Backtrader source

    Choose between the original mementum/backtrader package and the community-maintained backtrader2/backtrader fork. Both are GPL-3.0 and fully usable on TradingHost.

  3. STEP 03

    Add encrypted broker credentials

    For live trading, add IBKR, Oanda, or Visual Chart credentials as TradingHost secrets. They are encrypted, injected into the runtime at start, and never written to your repository.

    /platform/secrets/
  4. STEP 04

    Choose a region

    Select a region close to your broker’s endpoint. US-East for IBKR US trading, EU for Oanda Europe, and so on.

    /platform/regions/
  5. STEP 05

    Deploy

    TradingHost starts your Backtrader process in a managed container. Long backtests, optimisation runs, or the live loop all run in the same shape. Logs stream back to the dashboard.

    /platform/observability/

Section 06 · Maintenance reality

The original Backtrader and the community fork

Backtrader is a great library and also an honest one to talk about. The original repository at mementum/backtrader has been quiet since 2023. The community responded with backtrader2, a fork focused on keeping the project running.

For deployments, this only matters in one place: which version your repo installs. TradingHost is neutral on which copy you run. We just need to know.

mementum/backtrader
The original repository. Last meaningful commit on master in 2023. Stable for what it is, but new features and broker integrations are not landing here.
backtrader2/backtrader
Community fork created to keep the project alive. Initial scope is bugfix-only with ongoing maintenance. New broker drivers are not in scope yet, but the fork keeps the existing IBKR, Oanda, and Visual Chart integrations working with newer Python versions.
TradingHost stance
We run whichever version your repo pins, on whichever Python you choose. If your strategy is stable, you can keep using mementum/backtrader; if you want a maintained toolchain, point at backtrader2.

Section 07 · What we don’t do

What TradingHost does not do

  • TradingHost does not act as your broker.
  • TradingHost does not provide trading strategies, indicators, or financial advice.
  • TradingHost does not modify your Backtrader Strategy class or data feeds.
  • TradingHost does not custody your broker credentials beyond encrypted runtime injection.
  • TradingHost does not maintain Backtrader itself; we run whichever version your repo pins.

Section 08 · FAQ

FAQ

No. TradingHost is independent. Backtrader is open-source, GPL-3.0 licensed software originally maintained by the mementum project on GitHub.

The original mementum/backtrader repository has been quiet since 2023. A community fork at backtrader2/backtrader continues bugfix maintenance. TradingHost runs whichever copy your repo pins.

If your strategy already runs cleanly on mementum/backtrader, there is no urgent reason to migrate. If you are starting fresh, want compatibility with newer Python versions, or want to track ongoing fixes, point your repo at backtrader2/backtrader.

Interactive Brokers (via IbPy), Oanda v20 REST, and Visual Chart. The same Strategy class can run against any of these without code changes by switching the broker store at startup.

Yes, with custom data feeds and brokers. Backtrader does not ship native crypto exchange connectors, so you would either point a custom feed at CCXT or pair Backtrader research with a separate live framework. See /frameworks/ccxt/ and /frameworks/freqtrade/ for crypto-first alternatives.

You add them to TradingHost as encrypted secrets. They are injected into the Backtrader runtime at start and are not written to your repository.

Yes. Backtrader’s optimisation grid is compute-bound and runs cleanly inside a TradingHost runtime sized for the search space. The same runtime can later be reconfigured for live trading.

No. Backtrader places trades through your broker credentials. TradingHost runs the Backtrader process and streams logs.

Backtrader is event-driven and supports live trading; it is well suited to strategies that need bar-by-bar decisioning and live execution. vectorbt is vectorised and faster for parameter sweeps but does not include live trading in its open-source build. Many teams use both: vectorbt for screening, Backtrader for live.

NautilusTrader is a newer, Rust-cored event-driven engine designed for low-latency multi-asset deployments and identical backtest-to-live behaviour. It is actively developed. Backtrader is older, Python-only, more limited in venue coverage, but very approachable. See /frameworks/nautilustrader/ for the comparison.

Run your first Backtrader strategy

Connect GitHub, choose a Backtrader template or your own strategy repo, pin mementum/backtrader or backtrader2, add your broker credentials, choose a region, and launch into a TradingHost runtime.