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 that was, on reflection, predictable: the system does not yet understand the market it is being asked to forecast. It sees the price, a number. It can pull macro context, the book value of the companies in the index, the earnings. But it cannot put those things together into something that helps it understand the price.

I needed to simplify it for the system. I started by showing it what a price is made of.

I started building a new baseboard for the system. For any historical day on the S&P 500 or a sector fund, it decomposes the price into six numbers. The book value of the companies in the index. The premium the market pays above it for the companies' earnings. The contribution of the broader macroeconomic situation. The contribution of events. Media attention. And an arithmetic remainder I cannot yet fully name.

The thing I used to keep in spreadsheets and called the mood thermometer, which I wrote about in the past, worked from the same instinct. But that record, unlike the system I am building, worked more interpretively, more contextually, than this simplifying quantitative way. I now need to simplify first and add context gradually. Because I know that too much information, without a good explanation of how the pieces relate, can break the logic entirely.

Below I describe the six components of the price, one at a time. Then I share what surprised me on the chart when I looked back at my own best entries. And finally, what this step means for the predictive side of the system.

Six components of an asset price, in plain language

Six components sum to the price of the index to within a cent. Each has its own coloured band on the chart.

Book value, the bottom band. The price divided by the price-to-book ratio of the companies in the index. It represents the price the index would carry if all earnings premium, macro effect, media coverage and any other unidentified influence fell to zero: only the book value of the companies, scaled to today's share price. This is the first foundational layer of the chart, on which everything else sits.

Earnings premium. What investors pay above book value for the companies' ability to earn. Computed from long-run price-to-earnings and cyclically adjusted ratios, the same CAPE percentile against history from 1871 that I used in the first version of the prediction tool to classify market regimes. When this band grows on its own, the market is paying a higher premium for the same companies sitting behind it.

Macro contribution. Depends on a broad set of indicators: credit spreads, volatility indices, currency moves, real yields, inflation expectations.

Event contribution. Discrete impulses, not a continuous band. War, political shifts, an unexpected piece of news.

Media attention. A local language model scores the tone of the week's headlines on the asset.

Unidentified residual, the top band. The arithmetic remainder after the four observable parts of the price. I originally called this part of the chart sentiment. That was a quiet lie: the system did not measure sentiment, it computed a residual and labelled it with a word that suggested more than there was. The renaming itself was an honest step. The system will at least be aware that it does not know everything, and can reflect that in the future when assigning probabilities.

When the system started, this unidentified residual was more than half of every increment of the chart and was called sentiment. Two weeks of work on accounting for macro impact reduced it to a small part of the price.

The sum of these parts equals the price of the index or fund to within a cent.

What I saw, what I did not expect

When I had the chart ready for the first time, I looked back at the periods in which I had made the most money on shares. The entries were in phases the chart now shows as almost pure green. Book value and earnings premium were what I had paid for, not media hype or a temporary macro situation.