47
Part 1: Electronic Markets The Trading Theory Series

Quant trading theory series: electronic markets

Embed Size (px)

Citation preview

Page 1: Quant trading theory series: electronic markets

Part 1: Electronic Markets

The Trading Theory Series

Page 2: Quant trading theory series: electronic markets

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

Part 1: Electronic Markets

The Trading Theory Series

Page 4: Quant trading theory series: electronic markets

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

History

Page 6: Quant trading theory series: electronic markets

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

Open outcry markets

Page 8: Quant trading theory series: electronic 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

Page 9: Quant trading theory series: electronic markets

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

Increasingly relevant to all asset classes

Page 11: Quant trading theory series: electronic markets

Market participants

Page 12: Quant trading theory series: electronic markets

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

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

Limit order book (LOB)

Page 15: Quant trading theory series: electronic markets

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Apply your LOB knowledge

Page 32: Quant trading theory series: electronic markets

Visualising Bitcoin HFT strategies in LOB data

Image credit: parasec.net

Page 33: Quant trading theory series: electronic markets

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

Understand predatory HFT

A B

Page 35: Quant trading theory series: electronic markets

Understand predatory HFT

A B

MO100 units

£0.23 £0.23

Page 36: Quant trading theory series: electronic markets

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

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

Understand predatory HFT

A B

MO100 units

£0.23 £0.23

Page 39: Quant trading theory series: electronic markets

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

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

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

Market Making

Page 43: Quant trading theory series: electronic markets

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

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

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

Is HFT good?Does it damage markets?

Does it improve efficiency?Many more open questions...

Page 47: Quant trading theory series: electronic markets

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