Haplo

Can AI Predict the Stock Market? Our Own Model Barely Beat a Coin Flip

Machine learning has found small, real patterns in stock returns, mostly over months and across thousands of stocks. Calling tomorrow's move is another matter, and our own model's test results show why.

Haplo 11 min read

A one-euro coin spinning in the air above the thumb that has just flicked it, against a dark green background
Tomorrow's close, up or down: close to a coin flip · Photo: ICMA Photos, CC BY-SA 2.0 (Cropped to 3:2 and resized)

“Our proprietary AI trading system can’t lose!” is one of the sample pitches in a January 2024 investor alert from the SEC, FINRA and state securities regulators, who warned that fraudsters are using the popularity of AI to lure victims. It raises a fair question: can AI predict the stock market?

The research answer is unglamorous. Machine learning has found small but real patterns in which stocks do better than others over the next month. Whether a stock closes up or down tomorrow is still close to a coin flip, and edges that do turn up tend to shrink once people trade on them.

We make Haplo AI Investing, an iPhone stock research app whose models run on the phone, so we’ve measured this on our own work too. Below are what the studies found, what our next-day model scored on data it had never seen, and how to check any AI stock forecast. This is education, not investment advice.

Why stock prices are so hard to predict

The usual explanation is competition. If a pattern reliably pointed to tomorrow’s price, traders would act on it today, and their trades would move the price until the pattern disappeared. What’s left to move prices is mostly news nobody has yet.

The announcement of the 2013 Nobel prize in economics put it bluntly: “There is no way to predict the price of stocks and bonds over the next few days or weeks. But it is quite possible to foresee the broad course of these prices over longer periods, such as the next three to five years.” From the 1960s, Eugene Fama and colleagues showed that prices are extremely difficult to predict in the short run, and that new information is very quickly incorporated into them. The authors of the largest machine learning study below agree: “market efficiency forces return variation to be dominated by unforecastable news.”

A brass and black stock ticker under a glass dome, with a wheel of paper tape at the top and a ring of small lettered keys around its base, which reads Gold and Stock Telegraph Co. Universal Printer
A stock ticker built on Thomas Edison's design and submitted for an 1873 patent; it printed prices on paper tape · Photo: Jaclyn Nash, Smithsonian National Museum of American History, public domain

What machine learning research has found

The largest test: nearly 30,000 stocks over 60 years

The most cited study is by Shihao Gu, Bryan Kelly and Dacheng Xiu, published in the Review of Financial Studies in 2020. They gave a range of methods, from linear regression to random forests, boosted trees and neural networks, the same task: forecast each stock’s return for the next month from 94 characteristics, such as its recent price trend, size and trading volume. The data covered nearly 30,000 US stocks from 1957 to 2016; the models trained on the first 18 years, were tuned on the next 12 and were tested on the last 30.

Trees and neural networks won, but the win was small. The best, a neural network with three hidden layers, reached an out-of-sample R² of 0.40 percent a month for individual stocks: it explained about 0.4 percent of the month-to-month variation in returns. An ordinary regression given every input scored minus 3.46 percent, worse than a forecast of zero.

Small predictability adds up across thousands of stocks, though. Buying the tenth of stocks a neural network liked most and shorting the tenth it liked least, weighted by company size, earned 2.3 percent a month on average, with an annualised Sharpe ratio (return per unit of risk) of 1.35, against 0.61 for the same strategy built on a simple regression. Timing the S&P 500 with the network’s forecasts lifted the Sharpe ratio from 0.51 for buying and holding to 0.77. But the paper doesn’t subtract trading costs, and the stock portfolios turned over 110 to 130 percent a month.

The strongest signals were price trends (momentum and short-term reversal), then liquidity and volatility. Deeper networks didn’t help: performance peaked at three layers, which the authors put down to the small amount of data and the “tiny signal-to-noise ratio” of returns.

Daily calls that worked, then stopped

Thomas Fischer and Christopher Krauss trained LSTM networks, a kind of neural network built for sequences, to predict the daily direction of S&P 500 stocks from 1992 to 2015. Before trading costs, the strategy made 0.46 percent a day with a Sharpe ratio of 5.8, ahead of a random forest, a standard deep network and logistic regression. Then, in the authors’ words, “as of 2010, excess returns seem to have been arbitraged away with LSTM profitability fluctuating around zero after transaction costs.”

What ChatGPT-style models do with the news

Large language models bring a different skill: reading. Alejandro Lopez-Lira and Yuehua Tang had GPT-4 rate 159,137 headlines about 4,123 US companies as good, bad or neutral news, from October 2021 to May 2024, after its training data ended. A portfolio long the good news and short the bad made money on 93.3 percent of days in the market’s first reaction to overnight news, but nobody can trade a reaction that has already happened. The tradable part, the drift over the next day or two, made money on 58 percent of days and averaged 0.34 percent a day before costs. It was strongest in small stocks and after bad news, turned unprofitable at trading costs of 0.20 percent a round trip, and faded as the models spread: its annualised Sharpe ratio fell from 6.54 in late 2021 to 1.22 over January to May 2024.

Why next-day direction is close to a coin flip

We tested our own next-day model on this. It’s a logistic regression, a simple machine learning model, fed 14 inputs from each stock’s daily prices and volume, including past returns, the 14-day RSI, the MACD histogram, distance from moving averages and Bollinger Band position. It answers one question: will tomorrow’s close be above today’s?

The test is walk-forward, on 121 large US stocks with daily prices from January 2015 to July 2026. Each year from 2020 on is a test year, the model trains only on earlier data (with a 15-day gap so no training label peeks into the test year), and days are never shuffled.

Test year Predictions (stock-days) Right
2020 30,613 52.9%
2021 30,492 52.8%
2022 30,371 49.2%
2023 30,250 51.7%
2024 30,492 52.5%
2025 30,250 52.4%
2026 (to 8 July) 15,265 49.9%
All years 197,733 51.8%

These stocks closed higher on 51.6 percent of days, so always saying “up” would have scored 51.6 percent. That’s the base rate, the score for always guessing the most common outcome, and our model had mostly learned it: it called 89 percent of up days correctly and 12 percent of down days. Its AUC, which measures how well it ranks up days above down days, was 0.505, where 0.5 is a coin flip and 1.0 is perfect. And the 121 stocks are large companies that still exist today, which, if anything, flatters a model that leans “up”.

A fancier model isn’t an obvious fix: Gu, Kelly and Xiu found deeper networks did worse, and the daily LSTM edge vanished after 2010.

Two wooden Galton boards against a black background: in the left one the steel balls sit in a heap in the reservoir, and in the right one they have fallen through rows of pins into columns that form a bell shape
Galton boards at the Matemateca of the University of São Paulo, before and after. Each ball bounces left or right at every pin; the overall shape is predictable, but no single ball's path is · Photo: Rodrigo Tetsuo Argenton, CC BY-SA 4.0

What’s easier to predict: how much, not which way

The size of moves is another matter. Robert Engle shared the 2003 Nobel prize in economics for methods to analyse volatility that changes over time, and the announcement described the pattern plainly: “turbulent periods with large fluctuations are followed by calmer periods with small fluctuations.” Our own models, tested the same way, show the split:

The model predicts Right Always guessing the most common answer
Next day: up or down 51.8% 51.6%
Next 20 trading days: bottom, middle or top third of returns 37.9% 33.3%
Next 5 trading days: a stretched price snaps back, keeps going or stalls 40.1% 36.3%
Next 10 trading days: calm, elevated or stressed volatility 57.5% 33.3%

The volatility model beats its base rate by 24 points; the three that try to call direction beat theirs by 0.1 to 4.6 points. These are our measurements, not peer-reviewed research, but they line up with it: how much a stock is likely to move is far easier to forecast than which way.

Why market-beating patterns fade

Some patterns were never real, and the real ones get traded away. William Brock, Josef Lakonishok and Blake LeBaron tested moving-average and trading-range-break rules on the Dow Jones Industrial Average from 1897 to 1986 and found strong support for them. Ryan Sullivan, Allan Timmermann and Halbert White later adjusted for data snooping, the risk of finding a winner by luck after trying many rules on one dataset. The best rules survived over those 90 years, but for the next ten, 1987 to 1996, there was “scant evidence that technical trading rules were of any economic value,” and on S&P 500 futures, traded since 1984, no evidence they beat the benchmark.

Cheol-Ho Park and Scott Irwin’s review of 95 modern studies counted 56 positive, 20 negative and 19 mixed, with technical trading profitable in various markets at least until the early 1990s, but found most studies had testing problems: data snooping, choosing rules after seeing the results, and trouble estimating risk and trading costs.

Publication erodes returns too. David McLean and Jeffrey Pontiff followed 97 published predictors of stock returns: portfolio returns were 26 percent lower after the original studies’ samples ended and 58 percent lower after publication, which the authors read as investors learning from the research. Campbell Harvey, Yan Liu and Heqing Zhu argued that, with hundreds of factors already proposed, a new one should clear a t-statistic above 3.0 rather than the usual 2.0, and that most claimed research findings in financial economics are likely false. A flexible machine learning model searching many inputs faces the same trap, so only results on data it never saw count.

How we keep score on our own model

The out-of-sample figures above ship inside the app, and its notes on each signal set the model’s score beside the base rate. The next-day call is labelled a lean rather than a call, and the confidence the app shows for it is capped at 65 percent.

On each stock’s page, the models are also replayed over the last year of that stock’s prices: for each day, the app rebuilds the inputs from prices up to that day only, asks for the model’s call, checks it against what happened next, and reports the share it got right. That year may overlap the model’s training data, so the result sits next to the out-of-sample score, never in place of it.

The app’s simulated track record replays a rules-based strategy over the trailing year with twin models retrained only on data up to 8 June 2025 and scored only after it. Trades enter at the next day’s open and pay 0.05 percent in costs each way, on a fixed list of 40 large companies chosen in advance so the history can’t be cherry-picked. It’s marked as simulated and shown against simply buying the S&P 500, with its caveats: no dividend adjustment, some survivorship bias, one historical path. We don’t quote its results, because a simulation isn’t evidence of an edge.

How to check any AI stock prediction

The same questions separate evidence from marketing, whether the claim comes from an app, a newsletter or a paper:

  1. Was it tested on data it never saw? Accuracy on the data a model learned from proves very little. Look for out-of-sample or walk-forward results.
  2. What’s the base rate? Compare a hit rate with always guessing the most common outcome, not with 50 percent.
  3. Does it hold year by year? A pooled figure can hide one lucky stretch.
  4. Does it survive costs and realistic trades? Signals should be traded after they’re known, usually at the next open, with costs taken off. The news strategy above was still profitable at 0.10 percent a round trip and unprofitable at 0.20.
  5. How many ideas were tried? Test enough rules on one dataset and some will look brilliant by chance.
  6. Which stocks were tested? A list of today’s companies leaves out the ones that failed along the way.
  7. Does it promise anything? Regulators say to be wary of claims, “even from registered firms and professionals,” that AI can guarantee amazing investment returns. In 2024 two investment advisers settled SEC charges over false and misleading claims about their use of AI, agreeing to pay $400,000 in penalties; the SEC’s chair called it “AI washing”.

AI stock prediction FAQ

Can ChatGPT predict stock prices?

It reads news well, which hasn’t meant easy profits. In the Lopez-Lira and Tang study above, GPT-4’s portfolios matched the market’s first reaction to headlines on about 90 percent of days, but the tradable edge afterwards was far weaker, needed very low trading costs and faded as more investors used these models.

What accuracy is good for a stock prediction model?

There isn’t one number. What matters is the margin over the base rate, on data the model never saw, after costs. For next-day direction, 52 percent can be no better than always saying “up”. Treat very high daily hit rates as a reason to ask how the test was done.

Can AI predict the stock market in the long run?

Longer horizons do look more predictable, but that wasn’t a machine learning discovery. The 2013 Nobel announcement credited Robert Shiller’s finding, from the early 1980s, that the ratio of stock prices to dividends tends to fall when it’s high and rise when it’s low. That’s about the broad market’s odds over years, not a price on a date.

How we made this

Research figures come from each paper’s full text or published abstract; for Gu, Kelly and Xiu that’s the NBER version revised in September 2019, and for Lopez-Lira and Tang, version 6 on arXiv. Our model figures come from the manifest our training script writes and match the source code of Haplo AI Investing, which is also the source for the app’s scoring, replay and simulation rules. They are our measurements, not peer-reviewed research. Photos are from Wikimedia Commons.

References

Image credits