Richard Golian

1995-born. Charles University alum. Head of Performance at Mixit. 10+ years in marketing and data.

Castellano Français Slovenčina

Manage subscription Choose a plan

RSS
Newsletter
New articles to your inbox
Richard Golian

Article

Can AI Predict the Stock Market? Building a Calibrated System

Building a system to forecast the S&P 500 stock index with AI
Richard Golian
Richard Golian · 3 154 reads
Hi, I am Richard. On this blog I share my thoughts, not investment advice. This is not a recommendation to buy or sell securities.

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.

Richard Golian investing
A photo from 2024, when I entered the data into the spreadsheet by hand. I have been tracking various indices and ETFs for years.

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.

Richard Golian investing
Building an automated S&P 500 forecast with AI

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.

Continue

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…
Read only this one · €2,99

Get the full article by email and feel free to reply if you want to discuss it further.

Visa Mastercard Apple Pay Google Pay

Disclaimer

This series and any predictions it produces are not financial advice. They are a personal experiment in calibrated forecasting and decision discipline. Do not act on any prediction described here. Consult a licensed financial professional before making investment decisions.

Sources

FRED, Federal Reserve Economic Data (https://fred.stlouisfed.org/); Shiller online data (http://www.econ.yale.edu/~shiller/data.htm); yfinance public market data

Summary

I am developing an AI system for stock market prediction that runs on my own computer, uses publicly available data and scores its own predictions against reality. After four years of tracking stock market moods in a spreadsheet, I am building an automated version of my stock market predictions. This series of articles documents the development itself. What I eventually publish beyond writing about the development is a decision I will make later.

Common questions on this article's topic

Can AI predict the stock market?
Not with 100% certainty, but with a certain probability. My system can now 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. It does not predict peaks or bottoms with 100% accuracy: it says "valuations are in the 92nd percentile against history", not "the market will peak in eleven days".
How accurate is AI stock market prediction?
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. Before any number is considered meaningful, a minimum sample of thirty predictions per metric is needed.
What data does AI use to predict the stock market?
Every day, my system downloads S&P 500 OHLCV data, macro indicators from FRED and Shiller's CAPE series. It pulls data from yfinance for calculating the value of the asset. It then calculates the valuation metrics: trailing and forward P/E, price to book, dividend yield and the CAPE percentile against its history since 1871. I have not yet automated the effect of the media on price movements.
Can AI predict individual stocks?
My system does not predict individual stocks. As I argued in my article on investing in an index ETF, individual stocks are, for retail investors, like playing football against Messi. I am building the system to be suitable for analysing the S&P 500 index, not for Nvidia or Tesla.
Richard Golian

If you have any thoughts, questions, or feedback, feel free to drop me a message at mail@richardgolian.com.

NEWSLETTER
Findings, personal stories, mistakes and lessons learned. About AI, the internet and life.
Sent the first Sunday of the month. Unsubscribe anytime.

Related articles

What Determines a Stock Price?

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.

23 May 2026·1 609 reads
Market Fear and Outages at Banks, Airlines and Big Tech Companies: Which of My Predictions Are Coming True

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.

17 November 2026·484 reads
Can AI Replace Human Judgement?

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?

30 May 2026·1 595 reads

More articles

How to get your first job with no experience when AI is replacing entry-level jobs

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.

14 November 2026·533 reads
How a small business, creator or politician can be independent of big platforms in the AI age

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.

11 October 2026·1 373 reads
What should I study in the age of AI? What should I major in? Does a degree still make sense?

The development of artificial intelligence changes how we look at which paths in life make sense. Which studies and which profession to choose.

4 October 2026·1 063 reads
I Left My Job for Several Months to Read Philosophy

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.

28 September 2026·1 260 reads
How I Fell in Love With Her, at First Sight

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.

20 September 2026·1 222 reads
How to stop depending on social media, and what the IndieWeb is

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.

9 September 2026·1 342 reads
How to Start With AI in a Company

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.

12 August 2026·1 425 reads
Fable 5 vs Opus: the cheaper model won

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.

22 July 2026·1 647 reads
I Ran Object Detection on My Laptop, and Saw Everything Is Possible

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.

15 July 2026·1 304 reads
Dependent on AI: Are We Still Masters, or Slaves?

I have Heidegger and my notebook beside me. I am asking where all of this is heading, where artificial intelligence is taking us.

21 June 2026·2 065 reads
How to Find Blogs by Real People

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.

19 July 2026·1 669 reads
My blog is full of bots and AI agents

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.

6 July 2026·3 208 reads
Everything with AI agents, or fully offline.

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.

10.5.2026·2 313 reads
NEWSLETTER
Findings, personal stories, mistakes and lessons learned. About AI, the internet and life.
Sent the first Sunday of the month. Unsubscribe anytime.