Build a strategy backtesting engine with Claude Code

Describe entry, exit, stop and size in plain English; include fees and slippage; get win rate, max drawdown and a dashboard.

by Miles Deutscher8 Oct 2026

Prompt for your agent

Goal: Test a trading strategy on historical data before risking money.
Setup: agents used in source: Claude; tools/MCPs stated: TradingView.
Steps:
1. Open Claude Code and send the backtesting prompt (attached to the post).
2. Describe your strategy in plain English: entry, exit, stop, position size.
3. Tell it to include fees and slippage.
4. Run it and ask for win rate, max drawdown and average R per trade.
5. Ask for a dashboard to visualise the results.
6. Quality-check: import the source into TradingView and compare.
Rules: ask me before anything irreversible (sending, posting, paying, deleting); don’t invent data, results or tools I haven’t given you; tell me what you couldn’t verify.
Note: The author’s claimed returns are his own; past performance isn’t a forecast.
Based on: Miles Deutscher — https://x.com/milesdeutscher/status/2108079450927833334

Steps are from the source. Includes a “Based on” credit line.

I tried this

Tell the next builder. One anonymous answer each; click again to undo.

Agents, models and tools only what the source states

Agents
Claude
Tools
  • TradingView

Sources & credit