How to automate trading strategy backtests with AI agents
6 real setups for trading strategy backtests, most-discussed first. Steps come from each source; the full prompt is one click away.
6 real setups on agentsetups show how people automate trading strategy backtests with AI agents. Agents used: Claude (4), Grok Bot (2), Perplexity Computer (1), Codex (1).
Fastest start (from Build a strategy backtesting engine with Claude Code by Miles Deutscher):
- Open Claude Code and send the backtesting prompt (attached to the post).
- Describe your strategy in plain English: entry, exit, stop, position size.
- Tell it to include fees and slippage.
+3 more steps in the copyable prompt.
Last updated · based on 336 use cases on agentsetups, each credited to its author.
1. Build and backtest a trading bot with no coding background
Non-developers have an agent build, backtest and run a trading strategy; claimed results are unverified.
- Explain the market and the strategy idea in plain language; the author started with zero technical background.
- Have the agent backtest the strategy (Fable 5 was used for backtesting and building).
- Check the backtest for bugs. A separate dev.to write-up found its own backtest had bugs that inflated results.
- Run the bot from an agent you can talk to from your phone (GrokBot in the step-by-step source).
Claude, Grok Bot · by Davidd Tech (X post, 12 Oct 2026) · source
2. 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.
- Open Claude Code and send the backtesting prompt (attached to the post).
- Describe your strategy in plain English: entry, exit, stop, position size.
- Tell it to include fees and slippage.
- Run it and ask for win rate, max drawdown and average R per trade.
- Ask for a dashboard to visualise the results.
- Quality-check: import the source into TradingView and compare.
Claude · tools: TradingView · by Miles Deutscher (X post, 8 Oct 2026) · source
3. Give your trading bot an Obsidian second brain
Grok Bot and Claude Code built a 28,728-file vault from scattered charts, screenshots and notes; it then refused a trade.
- Gather charts, screenshots and notes from their separate places.
- Have the agents build an Obsidian vault from them.
- Have the trading bot check the vault before acting.
Claude, Grok Bot · tools: Obsidian · by Spike 1% (X post, 4 Sep 2026) · source
4. Build an MCP server for live stock data
Tired of pasting numbers, a builder made an MCP server for ~8,200 NSE and BSE stocks so Claude stops inventing P/Es.
- Build an MCP server over the exchange data you need (here all NSE + BSE stocks).
- Connect it to Claude so it pulls numbers instead of recalling them.
Claude · tools: MCP · by hit (X post, 20 Sep 2026) · source
5. Build a stock analysis terminal with Perplexity Computer
One instruction: a terminal for analysing $NVDA with real-time data from Perplexity Finance; no code written by hand.
- Give Computer one instruction: build a terminal to analyse a ticker using real-time Perplexity Finance data.
- Review what it builds.
Perplexity Computer · tools: Perplexity Finance · by Quant Science (X post, 13 Oct 2026) · source
6. Let Codex run hours of strategy backtests on screen
Codex operated the computer for 12 hours of iterative backtesting of an old Pine Script algo on LuxAlgo.
- Open the backtesting tool (here LuxAlgo, free).
- Have Codex operate the computer to run iterative backtests on the Pine Script algo.
- Let it run for hours and review the results.
Codex · tools: Pine Script, LuxAlgo · by TargetAcquired (X post, 7 Oct 2026) · source
Questions people ask
Which AI agent is best for automating trading strategy backtests?
In the 6 setups here, the agents named are Claude (4), Grok Bot (2), Perplexity Computer (1), Codex (1). That is what people used, not a quality ranking.
What do I need to automate trading strategy backtests with an AI agent?
An agent (Claude, Grok Bot, Perplexity Computer are the most common here). Each setup lists only the tools its source states.
Is there a prompt I can copy?
Yes. Every use-case page has a copyable prompt with the steps embedded and a “Based on” credit line, for example Build a strategy backtesting engine with Claude Code.
Related guides
- Best AI agent for finance and trading17
- Best AI agent for knowledge and memory14
- How to automate email triage with AI agents9
- How to automate a daily briefing with AI agents9
- How to automate lead generation and outbound sales with AI agents8
- How to automate meal planning and grocery orders with AI agents3
- How to automate subscriptions and household bills with AI agents6
- How to automate bookkeeping and invoices with AI agents4