The psychology behind stock prices

2022/09/11 — Mikaël Mayer

With so many ways to invest your spare money in today's world, stocks often come first in mind. Buying a company stock is literally buying a part of that company. You hope to get either dividends, or stock appreciation, or both. Although dividends are fixed by companies every quarter or every month, stock prices are not fixed by the company themselves. You've heard of supply and demand, high-frequency trading, market volatility, but what does the monster really look like?

Have you ever wondered why a stock price can go up and down so easily in a single day?

That's what this blog post is all about, and the answer is noted with . It's not about how to predict the market (sorry if you were expecting that, although maybe there could be a sequel, stay tuned!), it's also not about mid-term psychological trends, it's really about understanding how even a uniform and perfectly "uniformly distributed" thinking about a single stock can still lead to random price-moving and different stock prices at the end of the day. Yes! Uniformity still leads to randomness!

Who am I to talk about the stock market? I hold a PhD in computer science, I recently learned a lot about investments, and I started to analyze them with my forged deep analytical skills. After reading (actually, listening to) the excellent book that I recommend Rich Dad Poor Dad, I also recently read the excellent practical psychology book Never split the difference, and watched excellent youtube channels about investing such as PWL Capital Ottawa, The Investory. And I think I have something interesting to show you that is very little appreciated by the majority of humans:

How does a stock's market price go up or down?

Although, like everyone, I wished to have an answer that helps predict the market, I found at least a model that at least illustrated how a stock price can suddenly go up or down during a day. Let me share these "Aha!" moments with you that help me shed the light on something sometimes obscure. Story time!

The Company

Once upon a time, there was an automated Company that was earning $21 every month, that it entirely redistributed as dividends to shareholders. Since this company had 21 shareholders, each having 1 share, they each were receiving, you guessed it, $1 per month.

The Company decided to become public, and in that remote country, it :was free to file an IPO. On the first day of trading, the 21 Company's shareholders actually planned on selling their share, and 21 buyers planned on buying one share each. None of these sellers or buyers actually needed the money for their own needs, they were just in search of better investments.

The 21 shareholders (the sellers) had different expectations on rentability. As such, they each had a unique minimum selling price between $90 and $110. The 21 buyers also had different expectations on rentability, and they also had a unique maximum buying price between $90 and $110.

First question: Why would shareholders sell shares that bring free money in the first place? Here is the first "aha" moment I had. Let's look at the buyer's side first. What are the expectations of the buyers?

That makes sense. The buyers with the highest prices have the least expectations. Now, what on the seller's side? This is interesting and almost counter-intuitive! More often than not, when shareholders like you and I sell at a lower price than others, it usually means that they think Company is not performing as expected and they want to "limit their losses", not that they believe that the company is highly profitable. So what's the catch here? There is none. If a company is performing as usual, selling it at a way lower price than normal is not rational, unless the seller needs the money. Experienced buyers know this, as they think they buy a very profitable stock.

Now, what will now happen on the first day of trading?

The first day of trading

The day of trading goes as follows: One by one, a seller (or a buyer) enters the "market". The market is a place where they either find the best deal they can accept, or post publicly their selling (or buying) price.

For example, if a seller willing to sell their share for at least $106 enters the market, and the higher buyer already present is bidding for $108, then the seller will just sell their share for $108 and both :leave the market. To the contrary, if the highest buyer already present is bidding for $104, then this seller will just post publicly their selling price of $106 and wait :till the end of the day.

One crucial aspect of the simulation is, sellers and buyers enter in a random order. So, let's do a simulation of the day of trading. Click on "Next" to make a seller (or buyer) enter the market. Their minimum price (or maximum price) is indicated in parentheses:


No one is in the market.

NextRestart

Ok, we are onto something. We see clearly how deals can be "closed", and how the number of sellers/buyers can increase or decrease. But did you remark that every transaction has a different price? What else is striking? With all the steps being perfectly rational, you can already understand concepts that have real-life meaning:

We can see through this simple example how a stock price really reflects the offer and the demand.

Now, you might wonder, what does the evolution of the price really look like? And what other rational and uniformly distributed factors can still influence that price?

The Final Price

Let's draw the curve of the price during the day, from our simulator before. Press "Simulate" to generate a full simulation of our market: On the horizontal axis, the time. The vertical axis indicates the price. On each column, the price at which the last transaction happened.

Simulate>> x10>> x100

A few interesting observations. First, the "curves" obtained really look like typical stock price moves during the day of any company stock. This empirically confirms our model, despite it being based on totally rational agents with uniformly distributed expectations. Second, you can imagine that, when the price does not move, it means that a buyer or a seller entered the market but could not find a deal. Hence, if you want to visualize everyone - not just the last transactions, you can and re-run the simulations.

Now, let's assume there are 2x more buyers (each price has two buyers) than sellers, everyone still being perfectly rational. Press "simulate" to see what happens. Do you see a trend?

Simulate>> x10>> x100

A note on this simulation: Sometimes the final min seller price is "none". This is because all the sellers were able to sell their share. We do not count these cases into the computations :-)

Now, let's assume there are 2x more sellers (each price has two sellers) than buyers, everyone still being perfectly rational. Press "simulate" to see what happens. Do you see a trend?

Simulate>> x10>> x100

If you run this a lot of times, you'll come up with these stats: Beyond the timing of entering buyers and sellers, you now have another factor that influences the final price even in a perfectly rational market: the number of buyers vs. the number of sellers. Here is how we could manipulate a stock price by using this very interesting remark: So beware, the next time you buy a stock just because it was mentioned in some journal with a high audience. You might just be contributing to artificially increasing the stock and making sellers with high expectations happy :-). And beware, the next time you sell a stock because no one wants it anymore. The stock price might have artificially gone down because there were less buyers, for example because they are all scared of some bad news about the stock market (which sometimes has nothing to do with the company's actual performance).

Thanks for reading until now. I hope you had fun experimenting with a toy stock market!

Footnotes:

The cost of an IPO

Normally the cost of making a company's shares public is 3.5% to 7% of the estimated "market cap".

What Is an End of Day Order?

According to Investopedia, an end of day order is a buy or sell order for securities requested by an investor that is only open until the end of the day. This can be an order that initiates a new trade or closes an open trade, but either way, is set at a conditional price—usually as a stop or limit order.

What is an order book?

An order book is what was called the "market" in the story. As in the story, it contains bids from buyers and asks from sellers. You can learn more about order books there

Do you have an example of an order book?

You can find a real time example of an order book for example for cryptocurrencies here

How to read these complicated order books?

For real-life applications you can follow this excellent tutorial about real order books

What is the stock price normally?

In real life, normally, the stock price consists of both the maximum price offered by the highest buyer and the minimum price asked by the seller, or the average of the two - to remember only one number.

What happened with GameStop on Reddit?

GameStop's price increased despite rational analyses because a lot of reddit-propelled investors decided to make short sales to fail, which has the real effect of keeping the price artificially high.

What is the full market status?

Each column depicts what happens when someone new enters the market: 's' means there is a seller that did not sell yet, 'b' a buyer that did not buy yet, 'S' a seller that just entered the market and sold, 'B' a buyer that just entered the market and bought, and '-' indicates the last transaction price. :At any point, there is a gap between all the buyers (below) and all the sellers (above),