quant trading theory series: electronic markets
Post on 15-Feb-2017
148 Views
Preview:
TRANSCRIPT
Part 1: Electronic Markets
The Trading Theory Series
Notices
● Welcome back!● Trading competition v2.0● Quantopian sponsorship and prizes● Call for speakers● Call for project ideas● Chatwithtraders.com (Quantopian series)
Part 1: Electronic Markets
The Trading Theory Series
Trading theory series
Overview
● High level introductions● Quant trading topics● Part 1: Electronic markets● Part 2: Portfolio optimisation● Part 3: Trading costs
History
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?
Open outcry markets
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
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)
Increasingly relevant to all asset classes
Market participants
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
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
Limit order book (LOB)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
Apply your LOB knowledge
Visualising Bitcoin HFT strategies in LOB data
Image credit: parasec.net
Visualising betting strategies in LOB Data
K. Croxson & J. Reade. “Information and efficiency: goal arrival in soccer betting”. The Economic Journal 124. (2007)
Understand predatory HFT
A B
Understand predatory HFT
A B
MO100 units
£0.23 £0.23
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.23
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
Matched 20 units
£0.24 £0.23
Understand predatory HFT
A B
MO100 units
£0.23 £0.23
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.23
!!!
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.26
Take liquidity
Understand predatory HFT
A B
Matched 80 units
Route 20 units
MO100 units
£0.24 £0.26
Offer liquidity
Matched 20 units at 26p £
Market Making
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
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
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:
Is HFT good?Does it damage markets?
Does it improve efficiency?Many more open questions...
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
top related