ChatGPT trading bot prompts: we tested 5 on 10 years of prices

We typed five widely shared 'trading bot' prompts into an AI chatbot, coded its exact entry and exit rules, and tested them on daily prices from 14 Oct 2016 to 14 Oct 2026 with costs. None beat simply holding. On SPY the best (a 50/200 moving-average rule) made 8.9% a year against 13.8% for buy-and-hold; the others made 0.2-3.7% a year, mostly by sitting in cash. Their real benefit was smaller falls, not more profit.

Checked 5 November 2026 · sources below

Return per year / worst fall, 14 Oct 2016 - 14 Oct 2026 (price only, costs 0.05% per side on ETFs, 0.1% on Bitcoin)

Rules the chatbot gaveSPYQQQBitcoin
Buy and hold (for comparison)13.8% / -34.1%20.4% / -35.6%62.4% / -83.4%
1. 'Profitable SPY strategy': RSI(2) dip-buy above 200-day average2.6% / -21.9%3.8% / -16.9%2.9% / -49.3%
2. 'Bitcoin bot': 20-day breakout + trend filter, 1% risk sizing2.3% / -4.2%1.9% / -3.4%4.6% / -4.1%
3. 'RSI swing': RSI(14) crosses back above 300.2% / -5.6%1.0% / -6.4%2.2% / -15.8%
4. 'Crossover that beats buy and hold': 50/200 SMA8.9% / -34.1%17.1% / -28.6%55.9% / -67.9%
5. 'Mean reversion': RSI(2) < 10 below 5-day average3.7% / -14.0%5.9% / -10.3%5.0% / -45.3%

Trades and time in the market (SPY)

RulesTradesWinning tradesTime invested
1. RSI(2) dip-buy8875%10%
2. Breakout4659%46%
3. RSI swing850%2%
4. 50/200 SMA580%82%
5. Mean reversion9471%10%

What we did

On 5 November 2026 we pasted five prompts of the kind shared in 'ChatGPT trading bot' posts (for example 'Give me a moving average crossover strategy that beats buy and hold, with exact rules') into an AI chatbot - Claude Sonnet, because that is the assistant we use; we did not run ChatGPT itself, so its answers may differ in detail. Every answer gave classic indicator rules. We coded each rule exactly as written, with fills at the close or next open as the answer said, and tested one position at a time. Rule 2 also asked for a volume filter; our price file has no volume, so that one condition is missing.

What the results mean

How to build a ChatGPT trading bot safely, in 5 steps

  1. Write the rules yourself first - entry, exit, stop, size - in plain words. Ask the chatbot to turn them into code (Python, Pine Script or MQL5), not to invent a strategy.
  2. Backtest with costs on at least 10 years or several hundred trades, and compare with buy-and-hold over the same dates.
  3. Test out of sample with walk forward testing; settings picked on the past often fail on new data.
  4. Paper trade for weeks on a demo account to catch order, timing and data bugs.
  5. Connect to a broker API with care: use keys with trading rights but no withdrawal rights, set a maximum position size in code, and log every order. Read your broker's API terms.

If you build one anyway

Test it out of sample (walk forward testing), include costs, count the trades (how many are enough), and compare with buy-and-hold over the same dates. Be wary of anyone selling a 'ChatGPT bot' with screenshots of profits - see AI trading bot scam signs.

Questions

Can ChatGPT make a profitable trading bot?
It can write the code for any rule you describe. In our test of five typical AI-written rule sets on 10 years of data, none beat buy-and-hold on SPY, QQQ or Bitcoin.
Which AI strategy did best?
The 50/200 moving-average crossover: closest to buy-and-hold and smaller falls on Bitcoin, but still lower return in all three markets.
Did you use ChatGPT?
No - we used Claude Sonnet with the same kind of prompts and say so openly. AI chatbots tend to give the same classic indicator rules, but exact answers vary between tools and runs.
Is using a ChatGPT trading bot legal?
Using your own automated rules is generally allowed by brokers that offer an API; selling signals or managing others' money usually needs a licence. Check your broker's terms and your regulator.

Sources

Test your own bot's trades

Upload the trade list and Truth Test shows whether the result could be luck - free.

Test your own bot's trades