How to Backtest a Trade Idea with Claude (Natural Language, 2026)
Use Claude Desktop with the TradeOdds MCP to backtest any trade idea in plain English. Three example prompts and what to expect.
You don’t need to write Python to backtest a trade idea anymore. With Claude Desktop and the TradeOdds MCP server, you can describe an idea in plain English and Claude will run the historical lookup, summarize the result, and surface the underlying data. This is the fastest path from “I have a hunch” to “this is what the historical record actually says.”
This guide walks through three increasingly ambitious prompts and what they return.
Prerequisites
- Claude Desktop installed.
- TradeOdds Pro tier or above ($29/month).
- TradeOdds MCP server configured. If you haven’t done this yet, the five-minute walkthrough is at how to connect Claude to market data.
What “backtest” means here
Strictly speaking, what you’ll do is historical base rate lookup, not full strategy backtesting with portfolio sizing, commissions, and slippage. For that, use QuantConnect or Backtrader. But before committing engineering time to a full backtest, you should know whether the idea has any historical edge at all. That’s what this workflow gives you in seconds.
Prompt 1: Simple single-stock setup
Open a new Claude conversation and try:
“Use TradeOdds to check what happens to SPY in the next 5 trading days after it drops 3% or more on a day when VIX is above 25.”
What Claude does:
- Recognizes this as an
analyzecall. - Submits the conditions to the TradeOdds API.
- Returns something like: “Looking at 164 matching days over the last 35 years, SPY closed higher 64.0% of the time in the next 5 trading days, with a mean return of +1.37%. The pattern was strongest in the 2008 and 2020 stress windows.”
You now know: the idea has a real historical edge worth investigating further. 164 matches is enough sample size to take seriously.
Prompt 2: Cross-symbol scan
Once you have a setup that works on one stock, ask Claude to test it across the universe:
“Run a Factor Match scan for stocks currently in a bull regime with RSI in the oversold zone. Show me the top 10 by historical 5-day win rate.”
What Claude does:
- Calls the
factor_matchtool with the specified conditions. - The server scans 3,200+ active symbols and ranks results.
- Claude returns a ranked list with symbols, historical sample sizes, and win rates.
Useful for finding which stocks have the strongest historical response to the same setup. Often the surprises (an obscure mid-cap with a 78% win rate over 80 instances) lead to the most interesting research threads.
Prompt 3: Custom SQL (Power User tier required)
If you have Power User tier and the setup needs custom logic the prebuilt tools don’t support, Claude can write SQL:
“Write a SQL query against daily_metrics that finds every SPY day in the last 35 years where the prior 3 days were all negative AND VIX rose by 20%+ within those 3 days. Return win rate over the next 5 days and median return.”
What Claude does:
- Calls the
querytool with SQL it generated against the schema. - The query runs against the indexed factor columns; result returns in milliseconds.
- Claude explains the SQL it wrote AND the result.
This is the most powerful pattern: you describe a complex condition Claude couldn’t have hit with analyze or factor_match, Claude translates to SQL, runs it, returns numbers. If the SQL is wrong, you ask Claude to refine it. The iteration cycle is seconds.
What to do with the result
Claude returns a base rate. That base rate is not a prediction — it’s the historical frequency of a particular outcome under similar conditions. To decide whether to act:
- Check sample size. Under 20 matches and the result is noisy. Above 100 and you have something meaningful.
- Check the date range. If all 32 matches happened in 2008-2009, the pattern may be regime-specific.
- Check the distribution, not just the median. A 64% win rate could have 5%-of-the-time -15% losses lurking. Ask Claude to show the percentile breakdown.
- Consider transaction costs. A base rate without slippage and commissions is best-case.
Ask Claude follow-ups like: “Show me the percentile distribution” or “Which years had the most matches?” The MCP tools support this without you needing to know the underlying data model.
When to graduate to a real backtest
Historical base rate lookup is fast but incomplete. The numbers above don’t model:
- Position sizing rules
- Commissions, slippage, market-impact costs
- Margin or leverage effects
- Portfolio interactions across multiple positions
- Re-entry rules and stop placement
When the base rate looks promising AND you’re prepared to commit real capital, the workflow becomes:
- TradeOdds (here): validate the setup has a real historical edge.
- QuantConnect, Backtrader, or your own Python: build a full strategy with sizing, commissions, slippage.
- Paper trade. Watch live for a quarter.
- Trade small. Scale up only if real-money tracks the backtest.
Steps 2-4 take significantly more engineering than step 1. The whole point of using Claude with TradeOdds at the front of the funnel is to fail fast on ideas that didn’t have edge to begin with — before you write the deployable strategy.
Common gotchas
Claude hallucinates a number. If Claude says “60%” without calling a tool, ask it to verify by calling analyze. The MCP setup gives Claude the ability to ground itself, but you may need to nudge it to actually use the tool.
Asking too many things at once. Claude can chain tool calls, but a vague prompt produces a vague answer. Be specific: which symbol, which conditions, which forward window.
Confusing base rate with prediction. Claude will sometimes phrase results as “SPY is likely to go up 64% of the time.” That’s wrong — the historical base rate is a statement about the past. Push Claude to use phrasing like “historically, 64% of similar days closed higher.”
Beyond Claude
The same MCP server works with Cursor (for in-editor coding workflows), Continue, and any future MCP-compatible client. The patterns above translate directly. ChatGPT users can do the same with the TradeOdds OpenAI Custom GPT — see how to build a Custom GPT for stock analysis.
Verification. Workflow patterns and tool names verified on June 4, 2026 against TradeOdds MCP server v3.x. The MCP protocol and Claude Desktop’s support for it evolve; the high-level pattern is stable.
Disclaimer. TradeOdds provides historical analysis for informational purposes only. This is not investment advice. Past performance does not guarantee future results.
Try It Yourself
Run a free historical analysis on any stock, ETF, or crypto.
Start Free AnalysisNo account required. 10 free lifetime analyses.