Trading Concepts

Introduction to Order Books and HFT Strategies for Order Books

Anon Trader Girl

Introduction to Order Books and HFT Strategies for Order Books

Table of Contents

Introduction to Order Books and HFT Strategies for Order Books

Almost all major electronic exchanges for every widely-traded asset class, whether it is equities, futures, FX, options, or even crypto, utilize order books. Having a deep understanding of how order books operate, their different characteristics, and understanding of other actors present on an order book are important skills to be successful as an HFT trader or quant.

What is an Order Book?

Before we go into any case studies, we first define what an order book is and explain different types of order priority. An order book is a collection of buy and sell orders for a specific asset ordered by price level and aggregating the volume of each order per price. The highest bid (buy) price and the lowest offer (sell) price make up the best bid-offer (BBO) for an exchange. Nowadays markets are highly complex and fragmented, leading to the same assets getting cross-listed on many exchanges. The highest bid and lowest offer prices across all exchanges an asset is listed on is referred to as the national best bid-offer (NBBO). For more info on NBBO, check out the Regulation NMS section in the Market Microstructure post. 

 

BTC Order Book

Types of Exchanges

When there are multiple buy orders at the same price for an asset, how does an exchange decide priority among these orders when a sell order for the same price appears? In general, there are 2 types of ways to match orders in an order book, depending on the exchange:

Price-Time:

The order that appeared first in the order book gets priority. If I submit a bid for SPY 1 second before a competitor at $425 for 1 share, I will get priority over my competitor when a sell order for 1 share at $425 appears. One additional caveat: for most exchanges, when you INCREASE volume for a particular order, you lose your priority in the queue, but you can DECREASE volume while still maintaining priority. For these types of exchanges, speed is of the essence and we will dive more into why in later case studies!

Pro-Rata:

Every order at the same price-level is filled proportional to their order size relative to the total volume at the price-level. For example, if I have 10 shares bid, while 2 other competitors have 20 shares and 30 shares respectively, I will get filled 10 / (20 + 30 + 10) = 16.67% of all sell orders for the same price. Each exchange has specific rounding logic to decide allocation but in general, when you hear pro-rata, think proportional to how much my order is relative to the total volume at a particular price-level.

 

Additional Terminology:

Theoretical Price (Theo):

As a trader or investor, one of the core principles is to value all assets you are trading, then buying below that theoretical price while selling above it (buy low, sell high!). How to generate such a theo is a non-trivial problem and one of the most lucrative areas in all of finance… for a discretionary hedge fund, there are elite teams of analysts and portfolio managers combing through financial statements, alternative data such as credit card transactions, investor calls, and loads of historical information to value different stocks, bonds and other instruments. For an HFT firm, there will be suites of algorithms using order book info, correlated assets, historical measurements, and many more to generate a theoretical price.

This series of cases won’t dive into how theoretical prices are generated but if there is enough interest, Vici can create additional articles/cases focusing here! For now, we just need to understand that a theo is what we believe an asset is worth.  

With just the above pieces of info, we can now dive into order book case studies that HFT traders and quants will investigate every day. Some of these concepts have appeared in past trading interviews.

Basic Case Study Questions

Each below case presents the existing bids and offers for an asset, and are tasked with coming up with your ideal bid and offer for each scenario. You can quote bids and offers at any $.01 increment for the below case studies. This $.01 increment is referred to as the tick size.

An example answer would be: I want to be bid: $.95 for 10 lots and offered: $1.05 for 2 lots

Note: this may be quite technical for click traders who are just trading for fun. However, it's basic knowledge if you want to be a market maker.

Other questions to ask:

What can cause market participants to pull or widen their orders in an order book?

Extrapolating from these toy case studies, are there rule-based quoting (diming / joining) strategies that you can generalize for? How are they different for a price-time v. pro-rata exchange?

Case Study 1 Price-Time Exchange:

Case Study 2 Pro-Rata Exchange:

Case Study 3 Skewed Volume Price-Time and Pro-Rata Exchange:

A.

B.

Case Study 4 Other people on Level Pulling:

For this case, you are already quoting on the order book: bid: $.95 for 2 lots and offered: $1.05 for 5 lots

 

Answers to the case studies can be found here.

Blog

TRUSTED BY 400+ TRADERS

Original, and occasionally funny essays about trading concepts and interview process.