You are on page 1of 41

Limit Order Books1

University of Oxford
Oxford-Man Institute

Álvaro Cartea
alvaro.cartea@maths.ox.ac.uk

November 29, 2021

1
Notes based on textbook “Algorithmic and High-Frequency Trading” with
Sebastian Jaimungal and Jose Penalva.
1 / 41
Limit Order Book

▶ During the trading day, all limit orders are accumulated in


the limit order book (LOB) until they find a counterparty for
execution or are cancelled by the agent who posted them.
▶ The counterparty is a market order which is an order to buy or
sell an amount of shares, regardless of the price, which is
immediately executed against limit orders resting in the LOB
at the best execution prices.

2 / 41
The Limit Order Book
▶ The limit order book is a record of collective interest to buy or
sell certain quantities of an asset at a certain price.
Buy Orders Sell Orders
Price Volume Price Volume
60.00 80 60.10 75
59.90 100 60.20 75
59.80 90 60.30 50
▶ Graphical representation of the limit order book:
Volume

Price

3 / 41
Market Orders
▶ An incoming market order is filled by limit orders from the
book.

Volume

Price
4 / 41
Market Orders
▶ An incoming market order lifts limit sell orders from the book.

Volume

Price

5 / 41
Market Orders
▶ An incoming market order lifts limit orders from the book.

Volume

Price

6 / 41
LOB

Price/time prioritised collection of buy and sell quotes

Buy Orders Sell Orders


Price Volume Price Volume
60 80 60.1 75
59.90 100 60.2 75
59.80 90 60.3 50

▶ The microprice is the volume weighted midprice

75 80
mp = 60 + 60.1 .
80 + 75 80 + 75

7 / 41
LOB

Price/time prioritised collection of buy and sell quotes

Buy Orders Sell Orders


Price Volume Price Volume
60 80 60.1 75
59.90 100 60.2 75
59.80 90 60.3 50
What happens if a market buy order for 100 shares comes in?
What happens if a market sell order for 100 shares comes in?

8 / 41
LOB
A market buy order for 100 shares comes in

Buy Orders Sell Orders


Price Volume Price Volume
60 80 60.1 75
59.90 100 60.2 75
59.80 90 60.3 50

▶ The first 75 shares are bought at 60.1


▶ The rest of the shares (25) are bought at 60.2

Buy Orders Sell Orders


Price Volume Price Volume
60 80 60.2 50
59.90 100 60.3 50
59.80 90 - -

9 / 41
LOB (part IV)
A market sell order for 100 shares comes in

Buy Orders Sell Orders


Price Volume Price Volume
60 80 60.1 75
59.90 100 60.2 75
59.80 90 60.3 50

▶ The first 80 shares are sold at 60


▶ The rest of the shares (20) are sold at 59.50

Buy Orders Sell Orders


Price Volume Price Volume
59.90 80 60.1 75
59.80 90 60.2 75
- - 60.3 50

10 / 41
Imagine that you are a market maker

▶ How do you make money in this business?

▶ What information do you use?

▶ How can you devise a strategy to make money?

▶ Are there any events that make you withdraw from the
market?

11 / 41
Imagine you are a market maker
▶ You can observe the entire LOB, but do not know who you
trade with

▶ Make money from roundtrip trades by posting limit buy and


limit sell orders (maybe you also send market orders)

▶ Must be prepared to hold inventories

A market making strategy

▶ Where to place your limit orders in the LOB?

▶ How do you react to order flow information?

▶ When is it good to cancel an existing limit order?

▶ How do you manage inventory risk?


12 / 41
Now imagine you are a large fund...

You are a large equity fund and must rebalance your portfolio.
What do you fear?
▶ being frontrun or detected by other ‘clever’ algorithms

▶ your order is too large and will move the market against you

▶ etc

13 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 9:30:0.0 to 9:40:0.0
25.55

25.5

25.45

25.4

25.35

25.3

25.25

25.2

25.15
0 2 4 6 8 10

14 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 10:0:0.0 to 10:10:0.0
25.5
25.48

25.46
25.44

25.42
25.4

25.38
25.36

25.34

25.32
0 2 4 6 8 10

15 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 11:0:0.0 to 11:10:0.0
25.45

25.4

25.35

25.3
0 2 4 6 8 10

16 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 12:0:0.0 to 12:10:0.0
25.5

25.45

25.4

25.35
0 2 4 6 8 10

17 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 13:0:0.0 to 13:10:0.0
25.42
25.4

25.38
25.36

25.34
25.32

25.3
25.28

25.26

25.24
0 2 4 6 8 10

18 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 14:0:0.0 to 14:10:0.0
25.42
25.4

25.38
25.36

25.34
25.32

25.3
25.28

25.26

25.24
0 2 4 6 8 10

19 / 41
Limit Order Book
Trade Activity
MSFT 20110322 : 15:0:0.0 to 15:10:0.0
25.42
25.4

25.38
25.36

25.34
25.32

25.3
25.28

25.26

25.24
0 2 4 6 8 10

20 / 41
Limit Order Book
Trade Activity

MSFT 20110322 : 15:50:0.0 to 16:0:0.0


25.4

25.35

25.3

25.25

0 2 4 6 8 10

21 / 41
Order Imbalance

22 / 41
Volume Order Imbalance

▶ Volume order imbalance is the proportion of best interest on


the bid and the ask side of the LOB, defined as

Vtb − Vta
It = ∈ [−1, 1]
Vtb + Vta

▶ Vtb is the volume at the best bid at time t.

▶ Vta is the volume at the best ask at time t.

▶ If It = 1 the LOB is buy heavy (pressure to buy the asset)


▶ If It = −1 the LOB is sell heavy (pressure to sell the asset)

23 / 41
Order Imbalance: ORIT

ρ # Buy Orders # Sell Orders


All 756 ( 67% ) 396 ( 33 % )
>0 568 ( 79% ) 155 ( 21% )
> 0.5 320 ( 84% ) 60 ( 16% )
<0 168 ( 43% ) 225 ( 57% )
< -0.5 39 ( 25% ) 116 ( 75%)

24 / 41
Order Imbalance

A slice of imbalance for MSFT 10:00am to 10:10am on 22 Mar


2011
Order Imblance
1

0.8

0.6

0.4

0.2

0
3.6 3.61 3.62 3.63 3.64 3.65 3.66
7
x 10

25 / 41
Predictive power of volume imbalance
▶ More aggressive market
▶ buys when imbalance is high, It > 1/3
▶ sells when imbalance is low, It < −1/3.

4
x 10
4.5
Market Buys
4 Market Sells
Number of Trades 3.5
3
2.5
2
1.5
1
0.5
0
Sell−Heavy Neutral Buy−Heavy
Imbalance Level
Figure: INTC: one month of NASDAQ trades. Imbalance ranges are
[−1, −0.33), [−0.33, 0.33], and (0.33, 1].

26 / 41
Midprice change 10ms after aggressive buy order

4
x 10
2
Sell-Heavy
Neutral
Buy-Heavy
1.5

0.5

0
−3 −2 −1 0 1 2 3
Midprice Change (ticks)

Figure: INTC: one month of NASDAQ trades. Imbalance ranges are


[−1, −0.33), [−0.33, 0.33], and (0.33, 1].

27 / 41
Midprice change 10ms after aggressive buy order

4
x 10
2
Sell-Heavy
Neutral
Buy-Heavy
1.5

0.5

0
−3 −2 −1 0 1 2 3
Midprice Change (ticks)

Figure: INTC: one month of NASDAQ trades. Imbalance ranges are


[−1, −0.33), [−0.33, 0.33], and (0.33, 1].

28 / 41
Midprice change 10ms after aggressive buy order
▶ Distribution of midprice change 10ms after a market buy
order.

4
x 10
2
Sell-Heavy
Neutral
Buy-Heavy
1.5

0.5

0
−3 −2 −1 0 1 2 3
Midprice Change (ticks)

Figure: INTC: one month of NASDAQ trades. Imbalance ranges are


[−1, −0.33), [−0.33, 0.33], and (0.33, 1].
29 / 41
Midprice change 10ms after aggressive buy order

4
x 10
2
Sell-Heavy
Neutral
Buy-Heavy
1.5

0.5

0
−3 −2 −1 0 1 2 3
Midprice Change (ticks)

Figure: INTC: one month of NASDAQ trades. Imbalance ranges are


[−1, −0.33), [−0.33, 0.33], and (0.33, 1].

30 / 41
Tick Activity
▶ Number of market orders that take place at ticks from
midprice.

4
x 10
7
Beyond first tick
6 Within first tick

0
Buys Sells

Figure: INTC: one month of NASDAQ trades.

31 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0, 0.1)

32 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.1, 0.2)

33 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.2, 0.3)

34 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.3, 0.4)

35 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.4, 0.5)

36 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.5, 0.6)

37 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.6, 0.7)

38 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.7, 0.8)

39 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.8, 0.9)

40 / 41
Order Imbalance

Midprice change pre/post MO event with ρ ∈ [0.9, 1.0]

41 / 41

You might also like