quant trading theory series: electronic markets
TRANSCRIPT
![Page 1: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/1.jpg)
Part 1: Electronic Markets
The Trading Theory Series
![Page 2: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/2.jpg)
Notices
● Welcome back!● Trading competition v2.0● Quantopian sponsorship and prizes● Call for speakers● Call for project ideas● Chatwithtraders.com (Quantopian series)
![Page 3: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/3.jpg)
Part 1: Electronic Markets
The Trading Theory Series
![Page 4: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/4.jpg)
Trading theory series
Overview
● High level introductions● Quant trading topics● Part 1: Electronic markets● Part 2: Portfolio optimisation● Part 3: Trading costs
![Page 5: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/5.jpg)
History
![Page 6: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/6.jpg)
A market matches buyers and sellers
Markets to trade assets come in many forms
● Southampton Free & For Sale facebook page● Shouting across the trading floor or down the phone● London Stock Exchange
A good market provides
● A fair price● Low cost● Liquidity● Transparency?
![Page 7: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/7.jpg)
Open outcry markets
![Page 8: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/8.jpg)
Stock exchanges become more automated
1971NASDAQ opens
Electronic quote system
1976NYSE DOT
Broker sends electronic orders
to floor
1987NASDAQ SOES
Investors send electronic orders
2001NYSE Direct+
Automated electronic
trading system
![Page 9: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/9.jpg)
Know the market to trade successfully
● Trading algo success depends on market structure● Understand impact of liquidity● Understand impact of spreads● Understand impact of trading costs
These are especially relevant to:
● Very large trades● High frequency trading (HFT)
![Page 10: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/10.jpg)
Increasingly relevant to all asset classes
![Page 11: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/11.jpg)
Market participants
![Page 12: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/12.jpg)
Asset types and participants
● Ordinary shares● Corporate bonds● Government bonds● FX● Commodities● Real estate● Derivatives: futures/options● Swaps● Mutual funds● ETFs
● Companies (IPOs)● Shareholders● Company directors● Mutual funds● ETFs● Hedge funds● Prop traders● Day traders● Retail investors● Market makers
![Page 13: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/13.jpg)
Different motivations to participate
Fundamental: not driven by the market, long term● Hedging (manufacturers, production, etc.)● Futures / options as insurance● Government intervention (QE, currency, buy/sell assets)
Proprietary: acts on current market information● Hedge funds● Day traders● “Prop shops”
Market makers: facilitate a market in order to make money
![Page 14: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/14.jpg)
Limit order book (LOB)
![Page 15: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/15.jpg)
Visualising the state of the LOB
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
BIDS ASKS
![Page 16: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/16.jpg)
Visualising the state of the LOB
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
Bid price
Mid-price
Ask price
![Page 17: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/17.jpg)
New LOs arrive and are matched
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 18: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/18.jpg)
New LOs arrive and are matched
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 19: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/19.jpg)
New LOs arrive and are matched
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 20: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/20.jpg)
New LOs arrive and are matched
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
Matched
![Page 21: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/21.jpg)
Visualising the state of the LOB
● Best bid and ask price define the spread● Liquid = small spread● Price is discrete (tick)● Tick price is smallest spread● Limit orders are posted to book● Limit orders are matched● Buys always higher than asks
![Page 22: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/22.jpg)
Matching via price-time priority
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 23: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/23.jpg)
Matching via price-time priority
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 24: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/24.jpg)
Matching via price-time priority
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
![Page 25: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/25.jpg)
Matching via price-time priority
● Best price (highest for bid, lowest for ask) has priority● Earlier orders have priority● Market orders before limit orders● Many other possible matching systems
○ E.g. auctions
![Page 26: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/26.jpg)
Matching market orders
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
MO
![Page 27: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/27.jpg)
Matching market orders
21
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
1 2£79.56 £79.55
MO
![Page 28: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/28.jpg)
Rerouting orders
1
£79.5
1
£79.5
2
£79.5
3
£79.5
4
£79.5
5
£79.5
6
£79.5
7
£79.5
8
£79.5
9
£79.6
0
£79.6
1
£79.6
2
£79.6
3
£79.6
4
£79.6
5
£79.6
6
1 2£79.56
MO
Rerouted
![Page 29: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/29.jpg)
Order types
● Limit orders○ Passive○ Liquidity providing○ Guaranteed price - undetermined time
● Market orders○ Aggressive○ Liquidity taking○ Immediately matched - undetermined price○ Effective price
● Many more order types● Orders may be rerouted
○ Regulation
● Fees charged for different orders (distorts market prices)
![Page 30: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/30.jpg)
Market technology
● Book can be lit or dark● Getting a direct feed:
○ Speed critical○ Length of cable critical (firm location)○ Large cost for direct feed $$$○ Larger cost for colocation $$$$$$$
● A technology race for participants
![Page 31: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/31.jpg)
Apply your LOB knowledge
![Page 32: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/32.jpg)
Visualising Bitcoin HFT strategies in LOB data
Image credit: parasec.net
![Page 33: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/33.jpg)
Visualising betting strategies in LOB Data
K. Croxson & J. Reade. “Information and efficiency: goal arrival in soccer betting”. The Economic Journal 124. (2007)
![Page 34: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/34.jpg)
Understand predatory HFT
A B
![Page 35: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/35.jpg)
Understand predatory HFT
A B
MO100 units
£0.23 £0.23
![Page 36: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/36.jpg)
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.23
![Page 37: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/37.jpg)
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
Matched 20 units
£0.24 £0.23
![Page 38: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/38.jpg)
Understand predatory HFT
A B
MO100 units
£0.23 £0.23
![Page 39: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/39.jpg)
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.23
!!!
![Page 40: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/40.jpg)
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.26
Take liquidity
![Page 41: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/41.jpg)
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.26
Offer liquidity
Matched 20 units at 26p £
![Page 42: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/42.jpg)
Market Making
![Page 43: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/43.jpg)
Market makers function
● Provides liquidity● Takes on the risk of price movements● Profits from offering a spread● Averse to holding assets● Large institutions● HFT often used
![Page 44: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/44.jpg)
Grossman-Miller Model solution
An agent wants to sell ‘X’ shares - what price do ‘N’ MM’s offer for their risk?
● MM will only buy assuming a subsequent sell● MM will ask for a premium to compensate risk of price movements● Agent is price sensitive -> won’t sell all shares above fair price
![Page 45: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/45.jpg)
Grossman-Miller Model solution
An agent wants to sell ‘X’ shares - what price do ‘N’ MM’s offer for their risk?
● MM will only buy assuming a subsequent sell● MM will ask for a premium to compensate risk of price movements● Agent is price sensitive -> won’t sell all shares above fair price
In equilibrium:
![Page 46: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/46.jpg)
Is HFT good?Does it damage markets?
Does it improve efficiency?Many more open questions...
![Page 47: Quant trading theory series: electronic markets](https://reader033.vdocuments.net/reader033/viewer/2022050803/58a3cb511a28ab98588b5713/html5/thumbnails/47.jpg)
That’s all!Get in touch
sotonquants.comfacebook.com/soton-qauntsmeetup.com/soton-quants
In 2 weeks:Part 2 - Portfolio optimisation
Speak to me if you have project ideas