TheoryCraft vs Backtrader (2026)

Backtrader is a Python backtesting library. TheoryCraft is the platform around it: an AI assistant, market data and scientific validation.

Backtrader is a Python library, not a platform. You install it, wire up your own data, and write every strategy by hand.

That is the nature of a framework: it gives you a solid backtesting engine and leaves the rest to you. There is no AI assistant, no bundled market data and no built-in walk-forward or Monte Carlo, because those are platform features, not library features. They belong to whatever environment you run the library in.

TheoryCraft is that environment, built as a platform. You describe an idea, an AI assistant writes and runs the backtest in standard Python, market data for 1,600+ instruments is already there, and walk-forward, Monte Carlo and overfitting checks are built in. You can still write every line yourself.

And the two are not mutually exclusive. TheoryCraft research runs in Python notebooks, so a library like Backtrader can run inside it: TheoryCraft is the platform, Backtrader is one library you can use within it.

pairs_research.ipynb
# Is a cointegrated pairs spread tradable after costs?
edge = Edge.pairs(longs="KO", shorts="PEP", zscore=2)
result = backtest(edge, data="2013..2025", costs=True)
trades: 618sharpe: 0.71max_dd: -9.9% edge: WEAK, rejected
Describe an idea in plain language. TheoryCraft writes the Python, runs the backtest, and you keep the notebook.

TheoryCraft vs Backtrader: feature comparison

Feature TheoryCraft Backtrader
AI drafts your strategy from a plain-language brief
Describe the idea; the assistant writes and runs it, and you keep full control of the code
It is a library, so you write every strategy yourself in Python
Connect your own AI agent (Claude, Cursor, Codex) via MCP
Native MCP server
No MCP or connect-your-own-agent
Flexible LLM access (included, or your own key)
Model included on the Managed plan, or your own key across 26 providers
No LLM access
Market data included (1,600+ instruments)
Forex, EU and US equities, metals, commodities, indices via Dukascopy Bank
Ships no data; bring your own (the bundled Yahoo loader is broken)
Scientific validation (walk-forward, Monte Carlo, overfit checks)
Layered Edge, Filters and Risk, each tested independently
Analyzers exist, but walk-forward and Monte Carlo are not built in
Open-source engine (Apache-2.0)
Free to inspect, fork and run
GPL-3.0 Python framework
Standard, portable Python (runs anywhere)
Readable code you can export and run anywhere, with no lock-in
Standard Python, the same language as TheoryCraft
Historical strategy backtesting
Across years of market data
Event-driven backtesting
Multi-asset markets
Forex, equities, metals, commodities, indices
Any asset, if you supply the data
Parameter optimization
Matrix and genetic search
Multi-core parameter optimization

AI on TheoryCraft vs Backtrader

Backtrader is a library, so it does not ship an AI assistant, an MCP server or an LLM integration. That is expected: those are things a platform provides, not a backtesting library.

TheoryCraft is the platform that provides them, around the same kind of Python:

  • From a brief to a backtest. Describe the idea and the assistant writes the code, runs the backtest, and reads back the results. You can also write every line yourself; the AI is a head start, not a black box.
  • Standard, portable Python. Each strategy is readable Python in a notebook you export and run anywhere, the same standard Python you would write with Backtrader.
  • Your own agent. Connect Claude, Codex, Cursor, Windsurf, VS Code, or Gemini CLI through a native MCP server.
  • Flexible LLM access. Use the model included on the Managed plan, or bring your own key across 26 providers.

Keep using Backtrader for what it is good at, and run it inside TheoryCraft when you want the assistant, the data and the validation around it.

Why traders pair Backtrader with TheoryCraft

A platform around the library

Backtrader gives you an engine and nothing else: you wire up data, write each strategy and read every result yourself. TheoryCraft is the platform around that work. Describe a strategy in plain language and the assistant writes the Python, runs the backtest, and reads back the numbers. You can still write the code yourself.

Market data that comes bundled

Backtrader ships no data, and its bundled Yahoo loader is broken, so you solve data plumbing before you can backtest anything. TheoryCraft bundles 1,600+ instruments across forex, EU and US equities, metals, commodities and indices via Dukascopy Bank, ready the moment you start.

Validation that is built in

Backtrader has analyzers, but walk-forward and Monte Carlo are not built in, so you assemble them yourself. TheoryCraft runs walk-forward analysis, Monte Carlo simulation and overfitting checks out of the box, testing the Edge, its Filters and its Risk rules each on their own.

Both are open, and you can mix them

Backtrader is open source under GPL-3.0, and TheoryCraft's backtesting engine is open source under Apache-2.0. Both run on standard Python you can read and keep. And because TheoryCraft research happens in Python notebooks, you can use a library like Backtrader inside it.

Stop guessing. Start proving.

Turn an idea into evidence. Build it, backtest it, and see whether the edge is real before you risk capital.

Frequently asked questions

Is TheoryCraft a good Backtrader alternative?

They are different kinds of tool. Backtrader is a Python backtesting library; TheoryCraft is a platform. TheoryCraft adds an AI assistant, bundled market data and built-in validation around standard Python, and because its research runs in Python notebooks, you can use a library like Backtrader inside it.

Do I have to use the AI, or can I write the code myself?

Either way. The assistant writes and runs a strategy from a plain-language brief, but every strategy is standard Python you can read, edit and write from scratch yourself, just as you would in Backtrader. TheoryCraft is AI-assisted: the AI drafts the code, you keep full control of it.

Are both open source, and is it the same Python?

Yes. Backtrader is open source under GPL-3.0, and TheoryCraft's backtesting engine is open source under Apache-2.0. Both run standard Python you can read and keep. The difference is what surrounds the engine: TheoryCraft adds the AI assistant, MCP, 26-provider LLM access, bundled market data and built-in validation, and you can even run Backtrader inside a TheoryCraft notebook.

Where does the market data come from?

From TheoryCraft directly. It bundles 1,600+ instruments across forex, EU and US equities, metals, commodities and indices via Dukascopy Bank, so you can backtest right away. Backtrader ships no data, and its bundled Yahoo loader is broken, so you have to source and wire up a feed yourself first.

Does TheoryCraft place live trades like Backtrader can?

No. TheoryCraft is for research and validation and never connects to your broker. You prove the edge first, then trade it wherever you like. Backtrader can optionally connect to live brokers, though it has had no new release since 2023.

More TheoryCraft comparisons