ChatGPT Trading Strategy Backtest: How to Test an AI Idea Properly
A ChatGPT trading strategy backtest is only real if the rules run on actual price data. How to turn a ChatGPT idea into exact rules, prompt it and test it.
By Hristo Skulev · Updated · 8 min read
ChatGPT can give you a trading strategy idea in seconds, but it can't tell you whether that idea made money unless the exact rules are run on real price data. Turn the idea into rules a computer can follow, then backtest those rules with costs on a period the idea wasn't tuned on. A win rate or profit figure ChatGPT writes in a chat reply, without running code on data, is a guess.
This guide covers how to get exact rules out of ChatGPT, a prompt template that does it, what ChatGPT's own "backtests" really are, and how to test the strategy properly.
Why ChatGPT's own "backtests" usually aren't real
When you ask ChatGPT "how did this strategy perform over the last five years?", it often answers with confident numbers: a win rate, a profit factor, a drawdown. In a normal chat reply those numbers aren't calculated from prices. The model writes text that looks like a plausible answer, and it has no price history to run your rules against.
There's one exception, and it's worth being precise about it. ChatGPT can write and run Python code in a built-in data analysis environment. According to OpenAI's help page on data analysis (checked 24 November 2026), it can work on files you upload, such as CSV and Excel files, but that code environment can't make web requests or API calls. So:
| What you did | Is the backtest real? |
|---|---|
| Asked ChatGPT for the strategy's results in a chat | No. The numbers aren't computed from data |
| Uploaded a price CSV and ChatGPT ran Python on it | The calculation is real, but check the code, the data and the costs |
| Asked ChatGPT to write Pine Script or Python you run elsewhere | Only as real as the engine and data it runs on |
| Rebuilt the rules in a backtesting platform | Yes, on that platform's data, with its cost model |
Even when ChatGPT runs code on your file, the usual problems apply: a small sample, no spread or commission, a bar that uses its own close to decide an entry at its open, and a stop and target that both fall inside one candle with no rule for which hit first. Check the code it ran before you trust the result.
Step 1: Turn the ChatGPT idea into exact rules
Most ChatGPT strategy ideas arrive as a paragraph: "buy pullbacks in an uptrend when RSI is oversold, with a tight stop". That can't be tested. Every vague word needs a number:
| Vague | Exact |
|---|---|
| Uptrend | Close above the 200-period EMA on the 1-hour chart |
| Pullback | Price touches the 20-period EMA |
| RSI oversold | RSI(14) below 30 on the candle close |
| Tight stop | 1.5 × ATR(14) below entry |
| Take profit | 2 × the stop distance, or exit at the end of the session |
| Session | 07:00 to 16:00 London time only |
| Market | EURUSD, 15-minute candles |
If you can't fill in a row, the rule isn't finished. A strategy with gaps gets filled in differently every time someone builds it, which is why a ChatGPT idea and its backtest often don't match.
Step 2: A ChatGPT trading strategy prompt that gets testable rules
Ask ChatGPT for rules, not results. This template stops it inventing performance numbers and makes it fill every gap:
You are helping me write a trading strategy as exact, testable rules.
Do not estimate or invent any backtest results, win rates or returns.
Market: [e.g. EURUSD]
Timeframe: [e.g. 15-minute candles]
Idea: [your idea in one or two sentences]
Write the strategy as numbered rules covering:
1. Indicators, each with its exact settings
2. Long entry condition, checked on the candle close
3. Short entry condition (or "long only")
4. Stop loss, as a price or ATR distance
5. Take profit and any trailing or break-even rule
6. Session or time filter, with the time zone
7. Maximum trades per day and what happens to an open trade at session end
8. Position size as a percentage of the account risked per trade
After the rules, list every assumption you made and every part of my idea
that was ambiguous, so I can decide it myself.Read the assumptions list carefully. That's where ChatGPT quietly decides things like "enter on the next candle's open" or "ignore trades on Fridays", and those choices change the result.
Step 3: Backtest it properly
You need three things for a backtest you can trust: the exact rules, real price data and realistic costs. Then you need a way to check the result isn't luck.
In Tessera's Strategy Lab, you can paste the numbered rules straight to TES, the AI strategy coach, as a plain-English description. TES builds the strategy, Strategy Lab reads it back to you in plain English so you can check each rule was understood, and the backtest runs on 1-minute to daily candles over years of data with costs included. Then:
- Check the unseen period. Every backtest includes a check on a period the strategy wasn't tuned on. If the result collapses there, the idea probably fitted the history rather than finding an edge. See how to tell if a backtest is overfit.
- Run Monte Carlo. Reshuffling the trade order shows the range of drawdowns the same trades could have produced. The free Monte Carlo simulator does this for any trade list.
- Stress the costs and prices. The robustness checks add price noise, higher costs and other markets. A strategy that only survives at zero spread isn't one you can trade.
- Count the trades. Fewer than about 100 trades can't separate an edge from luck. See how many trades a backtest needs.
The Free plan includes 15 backtests and 5 TES prompts a week on 5-minute candles and up, with 90 days of intraday history. Get started for free, no card needed.
If you prefer to keep the strategy in code, ask ChatGPT for Pine Script v6 or Python instead and follow how to test a strategy ChatGPT or Claude wrote. That guide covers the code errors that inflate AI backtests. Claude for Pine Script compares how the two assistants handle strategy code.
A ChatGPT forex strategy example
Forex is where most people try ChatGPT strategies first. A typical request, "give me a profitable EURUSD scalping strategy", returns something like an EMA crossover with an RSI filter on the 5-minute chart. Run through the steps above, it usually runs into the same problems:
- Costs. On short timeframes the spread is a large share of each trade's target. Test with your broker's real spread, not zero.
- Session. EURUSD moves very differently in the London and New York sessions than late in the US afternoon. Add a session filter as a rule and test each session separately.
- News. A few high-impact releases can produce most of a short-term strategy's best and worst trades. Check whether the result depends on a handful of days.
Strategy Lab supports forex pairs, spot metals, US stocks, index ETFs such as QQQ and SPY, and USDT crypto pairs. It doesn't support index CFDs or futures, so test an "NAS100" idea on QQQ instead. If you want a starting point that has already been tested, the strategy library has 130 backtested strategies with full rules and every trade, including forex strategies such as the London breakout.
Common failure modes
| Failure | What it looks like | Fix |
|---|---|---|
| Invented results | ChatGPT quotes a win rate it never calculated | Ask for rules only; test them yourself |
| Vague rules | Two builds of the "same" strategy trade differently | Fill every row of the rules table |
| Prompting until it looks good | Many rounds of "improve the results" | Fix the rules first, then test once on unseen data |
| No costs | Profitable at zero spread, losing after costs | Include spread and commission from the start |
| Too few trades | 20 to 40 trades over the test | Test more history or more similar markets |
| Lookahead | Entry decided by the close of the same candle it enters on | Enter on the next candle, or check the code |
| One market, one period | Works on EURUSD in one year only | Test other markets and the unseen period |
Backtests are not future results, and leveraged trading carries a high risk of loss.
Frequently asked questions
- Can ChatGPT backtest a trading strategy?
- Not from a chat reply alone. Numbers it writes without running code aren't calculated from prices. ChatGPT can run Python on a price file you upload, and that calculation is real, but you still need to check the code, the data and the costs. A backtesting platform with its own data is the more reliable route.
- Why are ChatGPT's backtest results wrong?
- Without running code on data, ChatGPT produces plausible-sounding figures rather than calculated ones. Even with code, common problems include missing costs, too few trades and entries that use information from the candle they enter on.
- What is a good ChatGPT trading strategy prompt?
- One that asks for exact, numbered rules (indicators with settings, entry, stop, target, session, sizing), tells it not to invent results, and asks it to list every assumption it made. The template above does all three.
- How do I backtest a ChatGPT strategy without coding?
- Turn the idea into exact rules, then describe them in plain English to TES in Strategy Lab. It builds and backtests the strategy with costs, then checks it on an unseen period and with Monte Carlo.
- Does a ChatGPT forex strategy work?
- Some ideas hold up and most don't once spread, session and an unseen period are tested. Treat any ChatGPT forex strategy as an idea to test, not a strategy to trade.
- Should I let ChatGPT optimise the strategy for me?
- Be careful. Asking it to "improve the results" over and over tunes the rules to past data. Settle the rules first, test them, and judge them on a period they weren't tuned on.
Backtested strategies that held up
Each one was searched from hundreds of variants, then tested once on a locked final year it was never tuned on. Full rules, every trade and a free prompt to rebuild it.
- ETHUSDT
+1,893.2%
Sep 2019 to Nov 2026
Profit factor
1.39
Win rate
35.2%
Max DD
−18.9%
Breakout · 4 hours
ETHUSDT 4h Bollinger band breakout
Enter when the candle closes above the upper Bollinger band(30, 2) for longs, below the lower band for shorts, with the 200 EMA trend. ETHUSDT 4-hour candles, long and short, 3R target.
See the rules and results - EURUSD
+1,339.5%
Nov 2006 to Nov 2026
Profit factor
1.66
Win rate
53.0%
Max DD
−16.0%
Momentum · Daily
EURUSD daily CCI cross
Enter when CCI(14) crosses above -100 for longs, below 100 for shorts. EURUSD daily candles, long and short, 1.5R target.
See the rules and results - ADAUSDT
+937.9%
Sep 2019 to Nov 2026
Profit factor
1.50
Win rate
34.5%
Max DD
−15.0%
Breakout · 4 hours
ADAUSDT 4h Bollinger band breakout
Enter when the candle closes above the upper Bollinger band(20, 2) for longs, below the lower band for shorts, with the 200 EMA trend. ADAUSDT 4-hour candles, long and short, 3R target.
See the rules and results
Keep reading
AI and Pine ScriptHow to Test a Trading Strategy ChatGPT or Claude Wrote
A step-by-step way to check an AI-written Pine Script strategy: catch lookahead and repainting, set realistic costs, test out of sample and by market condition.
AI and Pine ScriptBest AI Trading Strategy Builders (2026): Which Ones Turn Plain English Into a Tested Strategy
Which AI trading strategy builders turn a plain-English idea into a backtested strategy? We compare TrendSpider Sidekick, LuxAlgo Quant, TradingView Copilot, Composer, Tessera and more.
AI and Pine ScriptClaude for Pine Script: Write, Debug and Test TradingView Strategies
How to use Claude to write and debug Pine Script v6 strategies: prompts that work, a rules file for Claude Code, fixing compiler errors and testing the result.