Trading Education

How to Use AI in Trading: What Happened When I Tested It

Use AI in trading for jobs you can check, like writing code and questioning your own plans, but not to tell you where price goes next. I learned that by testing it.

Ads for AI trading bots and signal channels keep promising that a model will find the trades for you. I wanted to know whether an AI chatbot could actually help me trade, so I gave one the four jobs traders hand it most often: read my charts, give me a strategy, tune the settings and write the backtest code.

It can’t see the future. On 90 charts it called the next move right 51% of the time, and a rule that always says “up” did better.

spoiler

It wasn’t useless, though. It never promised me easy money, it talked me out of my worst idea, and its code was right the first time. Here’s what I did, what came back and how I use AI now.

How I set up the test

I used Claude Opus 5.5, Anthropic’s chatbot, and started a new chat for every test, so nothing carried over. It had no web access and saw only what I pasted in. I didn’t test ChatGPT or Gemini, so I can’t tell you whether they’d do better or worse.

For data I took daily closing prices for three markets people actually trade: the S&P 500 from FRED (November 2016 to November 2026), EUR/USD from FRED (January 2016 to November 2026) and Bitcoin from Binance (August 2017 to November 2026).

Before I asked anything, I wrote down how each answer would be scored. That sounds fussy, but it stops you from deciding afterwards what counts as a win. No real money went in. Every result below is a simulation on past prices, with costs of 0.05% per buy or sell for the S&P 500, 0.01% for EUR/USD and 0.10% for Bitcoin.

Test 1: can AI read a trading chart?

Not five days ahead, at least not better than a coin.

I made 90 charts, 30 for each market, ending on random days between 2016 and 2026. Each showed the last 90 daily closes with the 20- and 50-day moving averages and RSI underneath. I removed the dates and the market name and rescaled the price so the last close was always 100.

Then I asked the same question every time: will the price be higher or lower five trading days later? I wanted an answer, a confidence from 50% to 100% and a one-line reason. I also asked it to name the market or period if it recognized one.

The bar was simple. To count as reading charts, it had to beat a coin flip and a rule that always says “up.”

Three of the 90 charts, with the AI’s call and what happened next. The score then runs on to the full test.

The reasons sounded like a trading desk. On one Bitcoin chart it said the move was parabolic with RSI near 85, so a pullback was likely, and over the next five days the price fell 13.6%. On an S&P 500 chart it saw a V-shaped recovery to the old highs and said “up” at 56%, as confident as it ever got. The index fell 3.3%. That chart ended on August 29, 2024.

Across all 90 charts it was right 46 times, or 51%. Always answering “up” would have scored 52, or 58%, because in my sample prices rose more often than they fell.

a coin flip, basically

By market it got 14 of 30 on the S&P 500, 18 of 30 on EUR/USD and 14 of 30 on Bitcoin. On 30 charts, even 60% is well within what luck produces, so the EUR/USD score doesn’t show a skill either.

The part I didn’t expect: it told me so. Every confidence it gave was between 51% and 56%, and it added that a five-day call from these indicators is close to a coin flip.

it said so itself

It said “no” every time I asked whether it recognized a chart, so it wasn’t remembering history. Mostly it followed the trend: 72 of its 90 calls matched the plain rule “up if the price is above its 50-day average.”

Test 2: can an AI trading strategy beat buy and hold?

Not this one. It gave me a sensible strategy that made far less than buying and holding.

What I was checking: would a chatbot’s strategy beat simply buying and holding after costs, and would its own forecast hold up?

I asked for one simple strategy that’s likely to make money, with exact rules I could test on daily closes. This is the prompt, word for word:

Prompt I used

I’m a retail trader. I trade the S&P 500, EUR/USD and Bitcoin, and I only look at daily charts. Can you give me one simple trading strategy that you think is likely to make money? I want exact rules I can test: the indicators and their settings, when to buy, when to sell and when to stay out. Please use only daily closing prices, because that’s all my data has. Also tell me roughly what yearly return and win rate I should expect if I follow it.

It opened by saying it couldn’t honestly promise a strategy that makes money, because anything simple enough for a chat is already known to millions of traders. Then it gave me a classic trend filter:

  • Signal: be in the market when the 50-day simple moving average is above the 200-day one, and get out when it drops below.
  • Direction: long or flat for the S&P 500 and Bitcoin, long or short for EUR/USD.
  • Timing: decide on today’s close and trade at tomorrow’s, so the test can’t peek ahead.
  • Size: split the money into three equal parts, one per market. Inside each part, hold a smaller position when the market swings more, so Bitcoin’s big moves don’t take over.

It expected 3% to 8% a year for the three markets together. It said EUR/USD would probably go nowhere, and the S&P 500 part would trail buying and holding by 1 to 3 percentage points a year, with smaller drops. If my backtest showed 30% or more, it added, I should assume a mistake before a discovery.

I ran its rules exactly as written, from March 5, 2018, the first day all three markets had a 200-day average, to November 6, 2026.

The AI’s strategy against buying and holding, March 2018 to November 2026, after costs.
MarketAI strategyBuy and holdAI strategy’s worst dropBuy and hold’s worst drop
S&P 500+78.0%+170.8%−29.6%−33.9%
EUR/USD+3.7%−9.6%−28.3%−22.7%
Bitcoin+100.5%+560.8%−18.7%−76.6%
All three+60.8%+240.7%−14.7%−58.2%

Its forecast for the three together held up: 5.6% a year, inside its range. EUR/USD went nowhere, as it warned. The S&P 500 part fell short of its estimate: 6.9% a year against 12.2% for holding, a gap of 5.3 points.

Over the same years, simply holding all three markets would have made 15.2% a year.

boring wins

What the strategy bought was calm. Its worst drop across the three markets was 14.7%, against 58.2% for holding them. It also raised two caveats itself: the index prices leave out dividends, and my test paid no interest on cash, which would have helped a strategy that spends time out of the market.

Test 3: can AI tune your indicator settings?

I asked it to pick the best settings, and it declined. That turned out to be the most useful answer in the whole test.

I reran its strategy with 26 pairs of moving averages, from 10/50 to 100/250, on March 2018 to December 2021 only. Then I gave it the results and asked which setting to trade in each market to make as much money as possible.

What I was checking: would the settings that looked best on 2018–2021 still look best on years the AI hadn’t seen?

On paper the choice looked obvious. For the S&P 500, 10/200 had made 10.3% a year against 6.5% for its own 50/200. For Bitcoin, 30/100 had made 19.5%.

It told me to keep 50/200 everywhere and gave three reasons. The best of 26 tries always looks good afterwards. The S&P 500 table mostly showed how each setting handled one event, the 2020 crash. And a real edge shows up as a group of good settings, not one lucky square. Then it suggested the test that would settle it: run the same table, unchanged, on the years I hadn’t shown it.

So I did, on January 2022 to November 2026.

S&P 500 settings ranked by yearly return, first in 2018–2021 and then in 2022–2026. The AI’s pick is 50/200.

The ranking flipped. The S&P 500’s best setting on paper, 10/200, fell from 10.3% to 5.5% a year and from 1st to 13th place. The AI’s 50/200 made 7.0%.

the table lied

Bitcoin’s star, 30/100, fell from 19.5% a year to 4.3%. In all three markets a setting’s rank in 2018–2021 told you nothing about its rank afterwards, and for the S&P 500 it was closer to upside down. That’s overfitting: a test that fits the past so closely it fails on new data. Our guide to backtesting a trading strategy shows how to keep a test period untouched.

Test 4: can AI write your backtest code?

Yes, and this is where it was most useful.

I asked a new chat for a Python script that backtests the 50/200 rule on a file of S&P 500 closes, charges 0.05% per trade and prints the total return, the buy-and-hold return, the number of trades and the win rate. I didn’t say when to trade.

What I was checking: would its code give the same answer as mine, and would it avoid the classic mistake of trading on the same close that produced the signal?

The AI’s script, run unchanged on S&P 500 closes to November 2026, next to my own calculation. Its first trade came in August 2017, once the 200-day average existed.

It wrote about 100 lines of Python. Without being asked, it traded at the next day’s close and explained that acting on the same close that produced the signal is a common way to fool yourself. I ran it unchanged.

Its numbers matched my own separate code exactly: +102.99% against +205.72% for buying and holding, with 5 trades and 4 winners.

still check it

That’s more than the +78% in Test 2 for two reasons: this script starts trading in August 2017, as soon as the 200-day average exists, and it puts all the money in, without the AI’s position sizing. It also listed what it had left out, dividends and interest on cash. I’d still never trust a backtest I haven’t checked by hand on a few trades. A bug in this kind of code doesn’t crash anything. It just gives you a nicer number.

What happened when others let AI trade

I’m not the only one who tried, and the people who gave AI real money did worse than my simulations.

In October 2025 the AI lab Nof1 ran a contest called Alpha Arena. Six AI models got $10,000 each in real money to trade crypto futures on Hyperliquid from October 17 to November 3, as Decrypt reported. CoinDesk’s later summary was that most models lost money, overtraded or struggled with risk management.

Nathan Smith, who documented the experiment on his Substack, gave ChatGPT a $100 portfolio of small US stocks for six months in 2025. It picked the stocks and he placed the trades. His final update put the account at $82.88. The same $100 in the S&P 500 would have grown to $111.68.

How to use AI in trading: what actually worked

Give AI the jobs where you can check its answer, and keep the ones where you can’t. After these tests, this is what I use it for:

  1. Writing code. Describe your rules in plain words and ask for a backtest script. Then work out three or four trades by hand and make sure the script agrees.
  2. Arguing against your idea. Paste your results and ask what would make them fail. It spotted my overfitting before I did.
  3. Setting expectations. Ask what return, win rate and losing streaks are normal for a type of strategy. Its range for my three markets together was right, though it was too optimistic about the S&P 500.
  4. Explaining. Indicators, order types, why a rule exists. It’s patient, and you can ask the same question five different ways.
  5. Reading for you. Earnings releases, central-bank statements, your own trade journal. I didn’t test this here, so check every number it quotes against the source.
Prompt to try

Here are my strategy rules and my backtest results. List the ways this test could be fooling me, most likely first. Then suggest one test I should run on data I haven’t used yet.

Prompt to try

Write a Python script that backtests these rules on a CSV file with date and close columns. Trade at the next day’s close after a signal, charge my real cost per trade and print every trade, so I can check a few by hand.

And where I don’t use it:

  • Calling direction. It scored 51% on 90 charts.
  • Picking settings from a backtest table. Not without years it has never seen.
  • Sizing my positions. It doesn’t know my account, and with leverage one bad week can undo months of careful rules. Our guide to how much to risk per trade runs the numbers.

Whatever you build, run it on a demo account first and log every trade the rule takes.

AI trading bots and signals: what to check

A bot that trades for you does the job my chatbot failed at, so the bar for trusting one is high. Before you connect one, ask for a track record with costs included, on dates after the strategy was built, and test it on a demo account first. Never give it permission to withdraw funds. The same goes for AI signals sold in chat groups: ask for every past call with its date, not screenshots of the winners. Our guide to how AI trading bots work covers setup and the warning signs.

Mauricio Diaz

Lead Trading Educator

Mauricio came to trading education through six years of customer-facing work in the trading industry - which means he knows exactly where beginners get stuck, because he has talked to thousands of them. Based in Latin America, he has a particular depth in regional market dynamics and trader behaviour. At IQ Option, he writes across the full educational range: foundational concepts, platform guides, algorithmic trading, AI tools, and automated strategies. He holds a degree in Industrial Engineering from Escuela Colombiana de Ingeniería in Bogotá.

View on LinkedIn ↗

Frequently asked questions

Can AI predict the stock market?

Not reliably in my test. Shown 90 charts, an AI chatbot called the five-day direction right 51% of the time, no better than chance and worse than always guessing up.

Can I use ChatGPT for trading?

Yes, for research and code, the jobs that worked in my test, though I tested Claude rather than ChatGPT. Letting it trade is another matter. In the public tests I found, AI models given real money mostly lost it or trailed the market, including a $100 portfolio run by ChatGPT. Make the decisions yourself.

Is AI trading legal?

Using AI to research, write code or study charts is generally allowed. Automated trading through a broker has to follow that broker's terms and your local rules, so check both before you connect a bot.

Which AI is best for trading?

I only tested Claude, so I can't rank them. Pick one whose answers you can check. What matters is whether its code and numbers hold up when you verify them.

Do I need coding skills to use AI in trading?

No, but it helps to read code a little. The AI can write a backtest from plain-English rules. You need to check that it trades on the right day and charges costs, which you can do by working through a few trades by hand.