How are actual prices at exchanges determined? At first glance, it is a trivial question, the quick reaction “Demand and supply!” just barely scratches the surface. Follow us into the rabbit hole how exchanges work “under the hood”- and learn about order types, the importance of liquid markets and what lessons we as retail investors (or traders) can learn.

Exchanges are not pools

When buying or selling something at an exchange, one can get the impression that markets are like pools: individuals and institutions buy and sell assets continuously, thus providing and withdrawing assets continuously, like innumerable rivers flowing to and stemming from giant lakes.

But exchanges do not work like this. The number of assets that are bought is always the same as are sold at any given time. Exchanges enable direct transactions between the market participants: each time we buy or sell a stock, we buy/ sell it directly from someone else. Let that sink in: when we buy something, we (hopefully) have good reasons for that. We need a direct counterpart for the transaction, someone that is selling to us, having different reasons to sell it at exactly this time.

There is a formal way how we and all other market participants notify the exchange about our buying or selling ambitions: orders.

Order Types

There are two basic types of orders: market orders and limit orders. Both have their implications and thus specific use cases. We should be aware of those, otherwise we could be surprised about unintended consequences. Besides those two basic types, a lot of special variants exist. One widely used examples are so called Stop Orders- we will explain them, too.

Market Order

By using a market order we want an immediate execution, at the best available price. When buying, a market order expresses our will to purchase as soon as possible, we do not put a limit on how much we are willing to pay. When selling with a market order, we literally throw our asset to the market for immediate sale, without putting a price tag on it.

Limit Orders

Limit orders put a price tag on the asset: buy limit orders express that the buyer is willing to buy only a maximum price (the limit) for the asset- or less. Sell limit orders on the other hand signal the the seller is willing to sell at a specific price (or more). Limit orders stay in the market until the price limit is reached, this can take some time but the price limit is guaranteed.

Stop Orders

A special form of orders is called Stop Orders. It also comes in two forms: Buy Stop and Sell Stop. When the market reaches the defined stop level, those orders become market orders (without a price limit) and will be executed for the next price determined by the exchange. The Sell Stop can be used to limit losses: when we place them below the current price, our asset will be sold when the market moves below this stop trigger- Sell Stops are thus also known as Stop Loss Orders.

As Stop Loss Orders become Market Orders after the trigger is reached, the execution price is not guaranteed! Keep that in mind, illiquid markets can lead to large price jumps and larger-than-anticipated losses for unaware investors.

The Order book

Now, that we covered how we interact with a stock exchange via orders, lets have a look how an exchange processes those orders. Imagine a fictional stock exchange, opening at 09:00 am. We track the transactions of the fictional FooBar Corp. shares. The last traded price for FooBar corp at yesterday’s closing bell was at $100.

(1) At 09:05 a buy limit order is submitted: the buyer is willing to buy 100 shares for a price of not more than $100

(2) Two minutes later at 09:07, a potential seller is transmitting her sell limit order: she wants to sell 200 units, for a minimum price of $105

(3) One minute later another buyer is interested in 150 units, for no more than $99

(4) 09:09 a second potential seller will sell 50 units, for a minimum price of $103

(5) 09:10 another seller offers 100 units for a minimum of $103

(6) 09:10 a third buyer would buy 50 shares for a price no more than $102

(7) 09:12 seller number 4 offers 150 shares with a limit of $106

(8) 09:15 a fourth buyer hopes to make a bargain: 200 shares with a buy limit of $98

When we put the transactions of this 15 minute time-frame into a table, it looks like this:

Orderbook for FooBar Corp stocks

Order

Time

Buy/Sell

Qty

Price

(1)

09:05

Buy

100

Limit $100

(3)

09:08

Buy

150

Limit $99

(4)

09:09

Sell

50

Limit $103

(2)

09:07

Sell

200

Limit $105

(5)

09:10

Sell

100

Limit $103

(6)

09:10

Buy

50

Limit $102

(7)

09:12

Sell

150

Limit $106

(8)

09:15

Buy

200

Limit $98

Due to non-matching prices for supply and demand, during those 15 minutes there wouldn’t have been a single transaction. To understand why, we can re-arrange our table to compare quantities and prices:

Orderbook for FooBar Corp stocks (reordered)

Demand (Buy)

Supply (Sell)

Order

Time

Qty

Price

Time

Qty

(7)

$106

09:12

150

(2)

$105

09:05

200

(5)

$103

09:10

100

(4)


$103

09:09

50

(6)

09:10

50

$102

(1)

09:05

100

$100

(3)

09:08

150

$99

(8)

09:15

200

$99

Above table reordered the rows to have the supply and demand side both in blocks. Tables like this are called order books. They are continuously updated throughout the trading hours of the day, nowadays only in electronic form. A visualization of above’s order book shows why there wasn’t a single trade:

Visualization of a simplified orderbook

All participants submitted limit orders, and none of those limits fit to each other, no order can be filled.

Even if we increase the demand side (image buyer (8) asking for 1000 shares at $98), there still would be no trade in this constellation. As we stated in the introduction of this article: exchanges are not pool-like mechanisms. Every single trade is a direct transaction between two market participants.

Order Matching

So the question remains: how does the exchange match those orders? How do prices emerge? Lets introduce a new buyer:

(9) Buy 200 shares market (unlimited)

This buyer is willing to buy at any price. Sell Order (4) has priority as it has the lowest price and was first in its price level (time wise). This person will sell all 50 units to buyer (9), for a price of $103 each. Next in line (because it came one minute later than (4)) is sell order (5): This seller will give all 100 units of her stocks, also for $103. So, now buyer (9) already has 150 shares (for a price of $103). As the buy order was for 200 units, seller (2) comes into play: her sell order is filled only partially- 50 shares, for the price of $105 each. This order matching condensed into a table:

Orderbook for FooBar Corp stocks (order matching)


Demand (Buy)

Supply (Sell)

Order

Time

Qty

Price

Time

Qty

(2)

$105

09:05

50

150

(5)

$103

09:10

100

(4)

$103

09:09

50

(9)

09:15

200

any price

After those transactions are handled, the order book is in the following state: Orders (9), (4) and (5) have been filled and are removed from the order book (red entries in the table above). Order (2) was partially filled. And, finally a new stock price was determined: as the last transaction at our little exchange happened at the price of $105, this is what will run over the tickers, until this process repeats, again and again.

The described order matching algorithm is called “First In First Out” (FIFO), as the orders at identical price levels are handled by their occurrence. Of course there are other, more complicated algorithms out there, but their description is beyond the scope of this article. In general, exchanges try to satisfy as many buyers and sellers at possible, and avoid larger price jumps. As today’s exchanges do this electronically, in former times this was done by brokers, face to face in an so-called “open outcry auction”. Today we can see that in (now historical) movies only.

Liquid Markets

Now it´s time to introduce a new concept: Liquidity! The artificial market in our artificial example is not very liquid: there was only a single transaction in 15 minutes! Another downside of this illiquid market are the possible price jumps from one order matching to the next (5% in our example). This is due to a lack of market participants and therefore a lack of orders. Keep in mind that those jumps can occur in both directions! Especially with Stop Loss orders in mind: usually placed as safety net to prevent losses when a price crosses a certain price, a Stop Loss Order becomes a Market Order, once the price trigger is reached. Imagine the investor whose Stop Loss order gets executed at a price level down another 10%… Not every trader is aware of this.

And, remembering the point about the direct transaction between market participants and their individual reasons for buying and selling: is not hard to imagine why a market with more participants is better: during a sharp correction each seller needs a buyer, too. In an illiquid market it is simply less likely, that a buyer is present who will buy our shares.

In a liquid market, on the other hand, there are dozens, hundreds and even thousands transactions each minute. Each transaction resulting in a new price, creating an endless stream of price ticks. This also reduces the likelihood of partial executions, as in our example. Plus, market orders (and hence triggered Stop Loss orders) are less likely to lead to rude awakenings.

So what can we do to ensure liquidity? Basically we have have influence on two variables: First and most intuitively, on the stock (or other asset) we intend to buy. Second: the exchange where we end up buying/ selling our assets. Both options should be seen in combination. Usually, brokers allow us to select different exchanges before submitting an order. Be aware of brokers that restrict you to only one option! Chances are that your trading fees with that broker/exchange combination will be very low, but your broker may make money by bringing unaware customers to some obscure low liquidity exchange!

Times & Sales

Most brokers give you an indication about how many units of a specific assets are traded on an exchange. Look for a metric that is called “volume”- the number of units that was traded during a certain time period (usually one day). While high volume in theory can be a single trade with a high number of units, usually it is a good indicator for the liquidity of a market

Another, more informative measure are the to called Times & Sales (T&S). T&S are real-time lists of every transaction (like the one in our fictional example) that took place on an exchange, including a timestamp, price, direction and volume.

We can access T&S either through our broker’s web page, or via trading software. If we see a T&S like the following, we can’t expect our orders to be executed in a timely manner (and larger price jumps):

Time

Price

Qty

cum. Qty.

09:00:21

28.18

50

90

09:04:15

27.94

250

340

09:04:53

27.92

200

540

09:17:58

28.82

173

713

09:21:06

27.92

50

763

09:29:54

27.96

150

913

09:38:03

27.88

25

938

09:40:31

27.96

5

943

09:42:08

27.96

40

983

10:01:12

27.98

50

1033

Look at the large intervals between each trade, and the overall pretty small volumes that are going over the counter. That´s a real world example of a German small-cap stock, traded at an exchange aiming for retail traders.

This is an indication, that for this stock at that specific exchange mostly retail traders are interacting with each other. While the quantity of the each trade might fit your usual position sizes pretty well, this is what we can call an illiquid market. If markets have a violent downmove, it will be very difficult to get out of a position for a reasonable price. Remember: for every seller there has to be a buyer. This is also true for positions that are sold because of a triggered stop loss. A liquid market, by contrast, looks more like that:

Time

Price

Qty

cum. Qty

17:39:59

381.93

100

7249612

17:39:59

381.94

100

7249712

17:39:59

381.95

100

7249812

17:39:59

381.95

100

7249912

17:39:59

381.93

100

7250012

17:39:59

381.96

200

7250212

17:39:59

381.96

200

7250412

17:39:59

381.92

100

7250512

17:39:59

381.92

100

7250612

17:39:59

381.95

100

7250712

Also being a real-world example, this time we look at a well-known blue chip, traded at the NASDAQ. The same amount of trades as in above example, but this time executed within the very same second. Also note that the amount of money that is moved for each transaction, is way higher. More trades mean more orders which results also in a smoother price curve.

Summary

What is important for us as retail investors/traders? First, we have to look for liquid markets. As we have seen, exchanges are not pool-like mechanisms, but enable transactions between market participants. Exchanges constantly try to fit supply and demand with each other, their «job description» is to find the prices where demand and supply find their maximum.

he more participants within a market, the better. Liquidity is not only about the volume of single trades, it is about a constant flow of volume through time.

Another takeaway from this article is how orders work, especially the difference between market (unlimited) orders and limit orders. And that a stop loss order usually becomes a market order if the price threshold is reached.

If you have additional questions or feedback, please leave a comment or drop a mail to feedback@6xfreedom.com