๐Ÿ’ธ Sponsor the strip
REPLAUSE

AI-Trader

Config-driven Backtrader wrapper with 20-plus strategies and an MCP server

๐Ÿงฉ Build it Free 06 in Backtesting ๐Ÿ†• NEW TODAY
Any marketAI agent (MCP)Python

by whchien โ†’

1,070 GPL-3.0updated 28 Mar '26

Overview

AI-Trader is a config-driven Backtrader wrapper that runs 20-plus bundled strategies against stocks, crypto, and forex data from a YAML file or CLI.

  • Fortraders who want reproducible, version-controlled backtests without writing Backtrader boilerplate.
  • NeedsPython 3.11+, and either a PyPI install for the CLI or a source clone (uv/poetry/pip) for the config templates and examples.
  • Runsa Python CLI and library on top of Backtrader, with an optional MCP server so an agent can run backtests and fetch data.

Vibe it

Paste this into your AI agent. Write the first line, or take a suggestion; the copy carries your words.

Source: https://github.com/whchien/ai-trader โ€” clone it and read its README and examples before writing anything; its documented setup beats what you remember.
Stack: a config-driven Python wrapper over Backtrader, with strategies defined in YAML, a CLI, and an optional MCP server for agent-driven backtests.
Needs: Python 3.11+; `pip install ai-trader` for the CLI, or a source clone with `uv sync` for the config templates and example scripts.
Start: `ai-trader fetch TSM --market us_stock --start-date 2020-01-01` to pull data, then `ai-trader run config/backtest/classic/sma_example.yaml` to run the bundled example.
Done means: you show me the backtest's stats output (return, Sharpe, drawdown) for the example config, and the YAML file you used or edited.
Before you start, ask me: which market I want to test (US stock, Taiwan stock, crypto, forex), the symbol, and whether I have my own data file or want it fetched.

Something wrong here? Tell us โ†’