High Frequency Trading II: Limit Order Book

High Frequency Trading II: Limit Order Book

In this article series Imanol Pérez, a PhD researcher in Mathematics at Oxford University, and an expert guest contributor to QuantStart continues the discussion of high-frequency trading via the introduction of the limit order book.

As we saw in the in the first article of the series, the objective of electronic markets is to match participants that are willing to sell an asset with participants that are willing to buy it. This is mainly done via two types of orders: market orders and limit orders. Market orders (MO) are sent by participants that are willing to either buy or sell the asset immediately, preferably at the best available price. Limit orders (LO), however, do not share this urgency: these orders show the interest of the participant to buy or sell the asset at a particular price. Therefore, these orders are not generally executed immediately, since they will have to wait until some other participant is willing to fill the order at the price given by the LO — if such a participant ever arrives. Of course, the participant that sent the LO can decide to cancel it at any given point, if he or she feels it is convenient to do so.

Therefore, the price of a traded security is not given by a unique price. It is actually a collection of prices, which are given by all the available limit orders. These prices form the limit order book (LOB). If there are many limit orders in the LOB, arriving MOs will be more likely to be fully matched by these LOs at a good price. Therefore, issuing limit orders increases liquidity of the asset — they make liquidity. MOs, however, have the opposite effect: since they are matched with LOs, they effectively take liquidity from the market.

At a given time $t$, the bid price is defined to be the best available buying limit order, while the ask price is the best available selling limit order. The bid and ask prices are denoted by $P_t^b$ and $P_t^a$, respectively. The difference between the bid and ask prices is called the quoted spread:

$$\mbox{Quoted Spread}_t = P_t^a - P_t^b.$$

Common sense indicates that, in order to avoid arbitrate opportunities, the bid price cannot be larger than the ask price — that is, the quoted spread cannot be negative — although in special situations this does not hold. Generally, the size of the quoted spread depends on how liquid the security is: securities with high liquidity tend to have small quoted spreads, since the large number of LOs in the LOB tend to decrease the quoted spread. Illiquid assets, however, will usually have larger spreads. In some sense, the size of the quoted spread will determine the cost of trading, since the quoted spread is the price a trader will have to pay if he or she immediately buys and sells an asset at the best available price, assuming there are no other trading costs. This cost will be low in very liquid assets, but in illiquid assets this cost is something that should definitely not be overlooked.

As we have discussed, a security will never have a unique price. However, it is often useful to try to give a unique number as a representative of the price of the traded security. A popular way of doing so is computing the midprice, which is just the average of the bid and ask prices:

$$\mbox{Midprice}_t=\frac{P_t^a+P_t^b}{2}.$$

However, this price may be a bit unrealistic when the volume of limit orders at the best bid and ask prices differ significantly. In these cases, the microprice may be more useful, since it weights the bid and ask prices with the volumes posted at the best bid and ask prices:

$$\mbox{Microprice}_t = \frac{V_t^b P_t^a + V_t^a P_t^b}{V_t^b + V_t^a},$$ where $V_t^b$ and $V_t^a$ represent the volumes posted at the best bid and ask prices, respectively. For example, if the volume of limit orders posted at the best bid price is significantly larger than the volume of limit orders at the best ask price, the microprice will be pushed towards the ask price.


Fig 1 - LOB of a certain security. The quoted spread and midprice are indicated in the figure. Figure from Cartea, A., Sebastian, J. and Penalva, J.[1]

In the next article we will analyse the problem of optimal execution, where the objective is to either buy or sell a large amount of shares of a stock in an optimal way, in order to minimise price movements that are caused by our own trades. Understanding how market microstructure works is crucial to solve the task, as we will see.

Article Series

References