Article
Can AI Predict the Stock Market? Building a Calibrated System
In July 2024 I wrote about the changing moods of the stock market. I described tracking value indicators alongside media narratives, and I called it a mood thermometer. That article ended with a sentence I often come back to: the stock market is a reflection of collective human emotions and behaviour.
The question is whether AI can help me analyse and predict it. Can AI predict the stock market? Not with 100% certainty, but with a certain probability. I am trying to build it. What this tool can do today is estimate probabilities for price movements and identify the regime the index is in. It then tracks whether those probabilities will hold across hundreds of predictions. That is the system I am building.
Two years after I wrote about the stock market mood thermometer, it still lives in a Google spreadsheet, with value indicators in the columns and my own comments on what the financial press was saying next to them. It works for me. But it does not produce clear predictions that can be checked against reality. I do not know how many times I was right, how many times I was wrong, or whether I am better than a coin toss when I say I see a high valuation. My prediction system, which I am building with AI, is meant to change that.
I have been working on the stock market prediction system since five in the morning. I am writing this at eight. The first version is already running on my own computer. The pipeline works from start to finish. There are not yet enough scored predictions in it to tell me anything meaningful. That phase is only beginning. This article is the first in a series that documents the development itself, and what the system will tell me once the record starts to fill up.
WHAT IS MY AI PREDICTION SYSTEM BUILT ON?
The basis for what I am building is three of my earlier articles. Each one is a separate idea. Together they form the backbone.
The first is risk-reward asymmetry. Every prediction the system makes comes with explicit probabilities and a confidence score. It has to answer the question I keep asking myself out loud. If I am wrong, how much do I lose? If I am right, how much do I gain? And is the ratio in my favour?
The second underlying article is about decision quality mattering more than the outcome of a decision. It draws on Decision-Making in Marketing and Advertising Under Uncertainty and I make mistake after mistake. The main metric is not the hit rate. It is the calibration error. When the system says 70 per cent, will it be 70 per cent in reality? An automated prediction that says 95 per cent and is right 80 per cent of the time is more dangerous than one that says 70 per cent and is right 70 per cent of the time. The system I am building enforces this in its interface. The hit rate is never reported without the calibration error next to it. The numbers only become meaningful once the record has enough scored predictions.
The third underlying article is my stock market mood thermometer. I described it as my way of reading the market. It is about how expensive an asset was compared with its own history, also in the context of how the financial press was talking about it. I also wrote about this in The Stock Market Hums with Hope and Do you know what CAPE is?. In the first phase of development, the system formalises only the valuation side. It calculates the CAPE percentile against its history since 1871. It classifies the market into one of eighteen regimes. Every smart prediction depends on the regime in which it was made. I have not yet automated the effect of the media on price movements, but I plan to add it.
WHAT THE FIRST VERSION ACTUALLY DOES
Every day, on my own computer, the system downloads S&P 500 OHLCV data, macro indicators from FRED and Shiller's CAPE series. It also pulls data from yfinance for calculating the value of the asset.
Join the Library
The rest of this article is in the Library. Get full access to my findings, personal stories, and what I learn from the people I meet.
Join the Library · €29.99 per year How to get your first job with no experience… How a small business, creator or politician can be… What should I study in the age of AI?… I Left My Job for Several Months to Read… How I Fell in Love With Her, at First… How do you stop depending on social media? Can…Get the full article by email and feel free to reply if you want to discuss it further.
Disclaimer
Sources
Summary
Common questions on this article's topic
Can AI predict the stock market?
How accurate is AI stock market prediction?
What data does AI use to predict the stock market?
Can AI predict individual stocks?
Related articles
In April, in the first part of this series, I wrote about an AI prediction system I had started building on my own machine. At the time the software was a few hours old and the prediction record was empty. The record since then has shown one thing: the system does not yet understand the market it is being asked to forecast. It can pull macro context, book value, earnings. But it cannot put those together into something that helps it understand the price.
The world has changed. Every day brings news that shakes our confidence in its foundations. In some parts of the world, bank outages leave people unable to access the money in their bank accounts. Flights are grounded. The authorities tell us to prepare for worst-case scenarios and to stock up on basic food. And then there are those who deliberately stoke fears of what might happen, because they benefit from it. It is hard to separate useful news, which can show us how to prepare for a crisis or how to respond when it comes, from the hysterical shouting that fills the internet and attracts comments and shares far more quickly.
AI produces the graphic, the newsletter and the product page faster than a person. What is left for the one who used to do it is the judgement, knowing whether the output is good. But most people have worse judgement than AI. And whoever cannot judge quality cannot delegate either. How do you tell whether yours is the judgement a company relies on, or the kind it can replace?
More articles
Over the past few years I have interviewed hundreds of candidates for marketing specialist, advertising specialist and data analyst roles. I often invited beginners to interviews with a practical task: people who had only completed a course, had studied the subject, or had tried the work on a small project of their own. I saw in them the motivation to develop in the field.
Are you a content creator playing by the rules of YouTube, Instagram or Google? Are you a small business owner whose business model depends on how often Amazon recommends you, how expensive Facebook ad impressions will be or how expensive Google Ads clicks will be? If all or most of your contact with your audience or customers depends on a big platform showing you to them, you are not in a strong position.
The development of artificial intelligence changes how we look at which paths in life make sense. Which studies and which profession to choose.
It was Thursday, 31 March 2022, when I handed over the last of my responsibilities to my colleagues, closed my laptop and went to the library. I left my job for several months and immersed myself in philosophy. And I am immensely grateful for it. Today I am, like most people, on a merry-go-round, and it is hard for me to stop and think about the fundamental questions of my own life.
It was September 2023. My life, my work, everything was completely different from now. It was simpler. I owned almost nothing. I needed to film an advert, I went up to a floor inside the company where the product I needed for that advert was, and there I noticed her for the first time. She laughs at me when I describe it like this, but at that moment the universe told me, that is her.
How and why I am gradually leaving social media and the big platforms. When I read that Meta is testing a new way to charge for organic posts that link outside its platform, it confirms how right I was to become steadily less dependent on the big platforms and on social media. It does not mean I have left them completely. It means that whether or not I stay in touch with my readers depends on them less and less, and today almost not at all.
One of my family members described a firm that has its data in several different tools, and its employees still join it by hand, in spreadsheets. That is the ordinary state of firms. When somebody tells such people not to do it by hand and to use AI, they will not understand. Most firms do not even have the basic connectors between the tools they use. These firms need help with AI transformation.
The same task, two models. Fable 5 against Opus 4.8. On paper Fable is the better model, with a larger context and stronger specs. And still it lost. Opus handled the task with a single round of checking for 721,000 tokens, while Fable needed nine rounds and burnt through 2.78 million tokens. The difference was not in the model, but in how I set the task. And I know it, because I measured it.
A few weeks ago I installed a small local AI model on my laptop that watches a live camera feed. I turned the webcam on in the dark, and in near total darkness it recognised me and the objects in the room. That such things exist, I have known for a long time. What opened my eyes was the accessibility. I installed it in one prompt, free, and it runs entirely on my machine, sending data nowhere.
I have Heidegger and my notebook beside me. I am asking where all of this is heading, where artificial intelligence is taking us.
For years I mostly read books. I found blogs and articles by chance: on social media, or while searching for something on Google. In the age of AI that stopped working, a large share of new content online is now written or co-written by a machine. The internet is not one place, it has layers, and a part of the population has moved to the cozy web and to quiet personal blogs. I show what those layers are and how to reach them through RSS, a reader and one OPML file, on my own example with the Human filter.
I once wrote about building my own privacy-friendly analytics tool. It had bot detection from the first version, yet it was not enough. Direct visits took a strangely high share of my traffic. When someone claims that 20% of their visits are bots and 80% are humans, I used to think the same. Today I would say the opposite ratio is closer to the truth. This is how I got there.
Four days in Catalonia. No computer, no AI, almost no social media. I bought this notebook so that I could write down what I would think about, and what I would come across and learn on the trip.

