FullStack Alpha logo BestAITradingTools.com by FullStack Alpha
Red and green candlestick chart recovering after a pullback on a dark background

Backtesting deep dive

Backtrader Review | The Classic Python Backtester Nobody Is Updating

Backtrader logoBacktradermementum/backtrader

Backtrader is a free Python library that replays your trading idea on historical prices so you can see what would have happened, and it can also connect to a few brokers for live trading. It is famous for being easy to learn and well documented, which is why it has more than 23,000 GitHub stars. The catch: the code has not been updated since August 2024, its broker connections are dated, and users say it gets slow as your tests get bigger.

Think of it as a flight simulator for trading strategies: you fly your plan through years of past weather before you ever put passengers on board.

Listen · 1:34 audio briefing · voice: EricBacktrader Review | The Python Classic With Training Wheels
Read the transcript

For years, if you asked Reddit how to start backtesting in Python, the answer was one word. Backtrader. The code hasn't been updated since August 2024. So should you still use it?

Backtrader is a free Python library that replays your trading idea on old prices, trade by trade. Think of a flight simulator for strategies. You fly your plan through years of past weather before any passengers board.

Five things we like.

One, it's easy to learn, with docs and a quickstart people still praise.

Two, a realistic simulated broker with stop, limit, trailing and bracket orders.

Three, a hundred twenty-two built-in indicators, plus TA-Lib support.

Four, it grades results with stats like the Sharpe ratio.

Five, one line of code charts the whole run.

It reads CSV files or pandas data, and names Interactive Brokers and Oanda for live trading, though those links are dated.

Two cautions. Nobody's fixing bugs, so a future Python update could break it. And it slows down on big tests.

Best for beginners learning how backtesting works. Training wheels are supposed to come off. Scroll down for faster, maintained alternatives.

This is education, not financial advice. Your market edge starts with the right tool. Stay alpha.

FullStack Alpha Editorial Team

Reviewed by Jay Rocco, Chief Editor

What Is Backtrader and What Does It Actually Do?

GitHub page for Backtrader (mementum/backtrader)
mementum/backtrader on GitHub · 2026

Most traders test an idea the expensive way: live, with real money, and a story about why the last loss did not count. This library exists to stop that. It is a Python library for backtesting, which means replaying your strategy on old prices to see what would have happened, trade by trade.

You write a strategy as a small Python class with rules like buy when the fast average crosses above the slow one. Its engine, called Cerebro, feeds it price data one bar at a time, fills orders through a simulated broker, and reports the results. The simulated broker is surprisingly complete: market, limit, stop, stop-limit, trailing stops, bracket and one-cancels-other orders, plus commissions, slippage (the gap between the price you wanted and the price you got) and position-sizing rules.

The toolbox is deep. The README lists 122 built-in indicators, support for TA-Lib, multiple data feeds and timeframes at once, resampling daily bars into weekly ones, trading calendars, and analyzers such as Sharpe ratio and SQN that grade a strategy's results. Data can come from CSV files, pandas tables or online sources, and one line of code plots the whole run with matplotlib.

It can also trade live. The README names three broker integrations: Interactive Brokers, Oanda and Visual Chart. Read the fine print, though. The Interactive Brokers link depends on IbPy, an old package that is not even on PyPI, and the Oanda link uses an older REST connection. The last code update landed in August 2024, so those connections are aging with no one tending them.

Community Score

63 / 100

How we score
Adoption · How many people starred it
26.2 / 30
Maintenance · How recently the code was updated
3 / 25
Community sentiment · What traders say on Reddit and Hacker News
13 / 20
Builder activity · How many people built their own copy
13 / 15
License clarity · Whether you are clearly allowed to use it
8 / 10

GitHub data checked 2026. Community read: mixed.

Stars
23,610
Forks (people who built on it)
5,312
Written in
Python
License
GPL-3.0
Last update
2024-08-19
Markets
Stocks, Futures, Forex
Skill level
Intermediate

Works with

Any AI, through your own code
View mementum/backtrader on GitHub ↗

Is Backtrader Right for You?

Good fit if you are

  • Beginners learning to code trading strategies who want clear docs and thousands of examples online
  • Swing traders testing daily or weekly rules on stocks, futures or forex, where speed is not critical
  • Anyone following an older tutorial or course that is built around backtrader python code
  • Traders who want a strategy-testing habit before they spend a dollar on software

Skip it if you are

  • You plan to test thousands of parameter settings or minute-level data. Users report it is slow, and faster tools exist
  • You want live trading you can rely on for years. The project is no longer updated, and its broker connections lean on old packages
  • You want an AI assistant to build and run strategies for you. There is no AI or MCP integration here

The jargon, in plain English

Backtest
Replaying your strategy on old prices to see what would have happened.
Event-driven
The program steps through history one price bar at a time, like a real trader would. Realistic, but slower.
Indicator
A formula on price or volume, like a moving average, that a strategy uses to decide when to act.
Slippage
The difference between the price you expected and the price you actually got.
Sharpe ratio
A score for how much return a strategy earned for the bumps it took along the way. Higher is smoother.
Stale repo
A repo (a project's folder of code on GitHub) that nobody is updating anymore. It still works, until something around it changes.
GPL-3.0 license
A free-software license. You can use and modify the code, but if you distribute a modified version, you must share its source too.

What Do Traders Say About Backtrader?

Sentiment is mixed, and the split is predictable. Beginners love how fast they can get a first backtest running, and the documentation and quickstart guide get regular credit. It was the default answer to 'how do I start backtesting in Python' for years, and 23,600 stars and 5,300 forks (a fork is someone's copy they build on) show it.

The complaints come from people who stuck around. Event-driven backtests are slow, and experienced users on r/algotrading point newcomers to more actively maintained tools. The pattern is common: people learn the concepts here, then outgrow it. That is not a failure. Training wheels are supposed to come off.

“Backtesting is a very time consuming process in pyalgotrade or even backtrader.”
MoreEconomy965, r/algotrading, 2024

What they like

  • Very easy for beginners to get a first backtest running
  • Good documentation and quickstart guide
  • Huge library of indicators and order types

What they complain about

  • Slow event-driven backtests
  • Users steer people to more actively maintained alternatives
  • Many traders eventually outgrow it

How Do You Set Up Backtrader Safely?

Plain steps, fake money first. Keep your keys in a private settings file, never pasted into the code.
  1. 01Install Python and the libraryRun pip install backtrader. Add plotting with pip install backtrader[plotting], which also installs matplotlib.
  2. 02Get some price dataStart with a CSV file of daily prices or a pandas table. Simple, clean data makes your first results easier to trust.
  3. 03Write one simple strategyFollow the quickstart guide on backtrader.com and build a basic moving-average crossover. Keep it boring on purpose.
  4. 04Add realistic costsSet commissions and slippage in the simulated broker. A strategy that only works with zero costs does not work.
  5. 05Run, plot and question the resultRun cerebro.run(), then cerebro.plot(). Check the analyzers, then test the same rules on a different time period to see if the edge survives.
  6. 06Treat live trading as a separate projectIf you connect a broker later, keep API keys in an environment file, not in the strategy code, use the smallest size possible, and expect to patch older broker packages yourself.

What Do You Need to Run Backtrader?

  • Python on your computer

    It is a Python library. The README says Python 3.2 or newer, but any current Python is the sensible choice.

  • Historical price data

    Backtests need old prices. It reads CSV files, pandas data and some online sources.

  • A supported broker (only for live trading)

    Live trading works through a handful of integrations named in the README, each needing extra packages.

    Interactive BrokersOandaVisual Chart
  • TA-Lib (optional)

    Adds a large library of classic indicators if the 122 built-in ones are not enough.

What Are the Risks of Using Backtrader?

  • No updates since August 2024

    The last code push was August 19, 2024. Bugs stay unfixed, and future Python or library changes could break things with nobody coming to fix them.

  • Slow on big tests

    Stepping through every bar one at a time is realistic but slow. Testing thousands of settings or years of minute data can take a very long time.

  • Dated broker links

    Live trading leans on IbPy for Interactive Brokers, which is not on PyPI, and an older Oanda connection. Expect friction before any live order works.

  • Backtests flatter you

    A great backtest is not a forecast. Tuning rules until the past looks perfect, called overfitting, is the most common way beginners fool themselves.

  • Copyleft license

    Under GPL-3.0, if you distribute software built on it, you must share your source code. Fine for personal use, a real issue for a commercial product.

Not ready to run code yourself? Our hands-on AI stock tool reviews on AIStockPickerApp.com score finished products on five pillars, the AI stock tools directory at AIStockPickerApps.com sorts 200+ tools by the job they do, and AIStockTradingBots.com walks through broker APIs, bot setup and backtesting step by step. Or head back to the Trading Workflows home page to match tools to your own routine and budget.

What Are the Best Backtrader Alternatives?

Should You Use Backtrader? Our Verdict

This library is still one of the best classrooms in algorithmic trading. Clear docs, a gentle learning curve, a deep toolbox and years of community answers make it the fastest way to learn what a backtest is and how strategies break. For a beginner, that education is worth more than raw speed.

But do not mistake a classroom for a production system. The code has not moved since August 2024, the broker connections are aging and big tests crawl. Learn on it, build your process on it, then move your serious testing and any live trading to a tool that someone still maintains. Systems beat hacks, and a system needs a mechanic.

Community Score

63

out of 100 · method

More Backtrader Questions, Answered

Is Backtrader still maintained?

Not actively. The repo's last code push was August 19, 2024. It still installs and runs for many users, but new bugs and compatibility issues are unlikely to get official fixes.

Is Backtrader free?

Yes. It is free and open source under the GPL-3.0 license. You only pay for things like premium data or a broker account if you want them.

How do I install Backtrader in Python?

Run pip install backtrader, or pip install backtrader[plotting] to include charts. Then follow the quickstart guide on backtrader.com to write and run your first strategy.

Where is the Backtrader GitHub repo?

It lives at github.com/mementum/backtrader. The repo has more than 23,000 stars and 5,000 forks, and the docs are at backtrader.com.

Can Backtrader trade live?

Yes, through integrations with Interactive Brokers, Oanda and Visual Chart. They depend on older extra packages, so expect setup work and test with tiny sizes first.

Sources we checked

Incoming transmission | Free weekly newsletter

Stop paying for tools that don't earn their seat.

FullStack Alpha has tested 200 AI stock tools. Be honest: how many of yours do the same job, and which one did you forget you signed up for?

One email a week fixes that: which tools are worth the money, what they cost right now, and how the traders on this site wire them into a routine. Five minutes to read. Zero noise.

Free. One email a week. Unsubscribe in one click. We never sell your email.

  • Hot stock picks
  • Paid signal pitches
  • Fake countdown timers
  • Gurus selling courses

Inside every issue

5 MIN READ

  1. 01

    The Verdict

    One AI trading tool tested and scored. What it does well, what it costs, and the catch the sales page leaves out.

  2. 02

    Price Watch

    Price changes and live promos on the tools traders actually use, monthly and annual side by side, so you stop overpaying.

  3. 03

    Workflow Teardown

    One educator's routine taken apart: the scan, the chart, the tools, and the free swap for every paid one.

  4. 04

    Scan of the Week

    Exact scanner settings you can copy, pulled from the educator's own lesson with the timestamp.

Process beats prediction. This is the email that keeps your process honest.

FullStack Alpha logo

FullStack Alpha Network