microstructure tutorial

38
UIC ICFD Market Microstructure Tutorial R/Finance 2009 Dale W.R. Rosenthal 1 Department of Finance and International Center for Futures and Derivatives University of Illinois at Chicago 24 April 2009 1 [email protected] Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Upload: samuel-oduro

Post on 22-Mar-2016

285 views

Category:

Documents


12 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Microstructure tutorial

UIC ICFD

Market MicrostructureTutorial

R/Finance 2009

Dale W.R. Rosenthal1

Department of Finance andInternational Center for Futures and Derivatives

University of Illinois at Chicago

24 April 2009

[email protected] W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 2: Microstructure tutorial

UIC ICFD

Who Am I

Assistant Professor of Finance at UIC– Teach Investments; Market Microstructure; Commodities.

B.S., Electrical Engineering, Cornell U., 1995.Ph.D., Statistics, U. Chicago, 2008.

Programmer Intern, Listed Equities, Goldman Sachs, 1993–4.Strategist, Equity Derivatives, LTCM, 1995–2000.Trader/Researcher, Equity Trading Lab, Morgan Stanley, 2000-3.Self-employed Trader/Researcher/Coder, Summer 2004.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 3: Microstructure tutorial

UIC ICFD

What Microstructure Is — and Is Not

Market microstructure studies the details of how markets work.

Market microstructure is not “neoclassical” finance2.

often directly opposes Efficient Market Hypothesis.

If you believe markets are efficient:

the details of how markets work are irrelevant since. . .

you always get efficient price (less universally-known fee).

Thus microstructure embraces:

the possibility of short-term alpha; and

behavioral effects.

2“So you short one stock...” omits a lot.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 4: Microstructure tutorial

UIC ICFD

What I Cover in a Microstructure Course

When I teach microstructure, I cover many topics:

1 Market Types

2 Orders and Quotes

3 Trades and Traders

4 Market Structures

5 Roll and Sequential Trade Models ← Play with some

6 Strategic Trader and Inventory Models ← of these today.

7 Prices, Sizes, and Times

8 Liquidity and Transactions Costs

9 Market Metrics Across Time

10 Electronic Markets

11 Electronic Trading Tools and Strategies

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 5: Microstructure tutorial

UIC ICFD

Introduction

Today we’ll consider models for microstructure phenomena.

For these models, need to adopt a different perspective.

Models are simple; lets us conduct controlled experiments.

Eliminate all but one or two major factors.Question: Does this model reproduce real-life features?If so: factors we are considering probably matter.We may even have an idea about how those factors matter.

Less confusion about what matters helps build better models.

Newest research combining such models with time series.

All models are wrong; some models are useful.— George Box

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 6: Microstructure tutorial

UIC ICFD

Asymmetric Information Models

We will examine two asymmetric information models.

Asymmetry: Trades may contain private information.

Sequential trade: independent sequence of traders.

Traders: informed (know asset value) or not; trade once.Single market maker; learns information by trading.

Strategic trader: one informed trader can trade many times.

Informed trader considers own impact on later trades.Uninformed (noise) traders also submit orders.Single MM sees combined order, sets price, fills order.

Some slides are for you to study later; I’ll skip those.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 7: Microstructure tutorial

UIC ICFD

Glosten-Milgrom (1985) Model

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 8: Microstructure tutorial

UIC ICFD

Glosten and Milgrom (1985) Model

Most famous sequential trade model.

MM quotes a bid B and ask A.

Security has value V = V or V , V < V .

At time t = 0, informed traders (only) learn V .

Time is discretized.

Trades are for one unit, occur at each time step.

MM has infinite capital: no inventory/bankruptcy concerns.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 9: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Setup

V ∼

{V w .p. 1− δV w .p. δ

Trader type T ∼

{Informed w .p. µ

Uninformed w .p. 1− µ.

Traders take action S (buy/sell from MM), one at a time.

Informed traders: S ∼

{buy if V = V

sell if V = V.

Uninformed traders: S ∼

{buy w .p. 1/2

sell w .p. 1/2.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 10: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Event Trees

buy

I ; S =?

1 55jjjjj

0// sell

V V = V ; T =?

µ 33ggggg

1−µ ++WWWWWbuy

U; S =?

1/2 55kkkkkk

1/2// sell

V =?

1−δ=={{{{{{{{

δ !!CCCC

CCCC

I ; S =?0 //

1 ))SSSSS buy

V V = V ; T =?

µ 33gggggg

1−µ ++WWWWW sell

U; S =?1/2 //

1/2 ))TTTTT buy

t = 0 t = 1, 2, . . . sell

V = security value (V ,V)

T = trader type (Informed/Uninformed)

S = trader’s side (buy/sell)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 11: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Likelihood of Buys and Sells

What is P(buy), P(sell) after one trade?

P(buy) = P(buy|V )P(V ) + P(buy|V )P(V ) (1)

=(1− µ)δ + (1 + µ)(1− δ)

2=

1 + µ(1− 2δ)

2(2)

P(sell) = P(sell|V )P(V ) + P(sell|V )P(V ) (3)

=(1 + µ)δ + (1− µ)(1− δ)

2=

1− µ(1− 2δ)

2(4)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 12: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Likelihood of V , V

After one trade, we have information via Bayes’ Theorem:

P(V |buy) =P(buy|V )P(V )

P(buy)=

(1− δ)(1 + µ)

1 + µ(1− 2δ)(5)

P(V |buy) =P(buy|V )P(V )

P(buy)=

δ(1− µ)

1 + µ(1− 2δ)(6)

P(V |sell) =P(sell|V )P(V )

P(sell)=

(1− δ)(1− µ)

1− µ(1− 2δ)(7)

P(V |sell) =P(sell|V )P(V )

P(sell)=

δ(1 + µ)

1− µ(1− 2δ)(8)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 13: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Bid, Ask, Spread

If competition narrows profit to 0, before trading. . .

A = E (V |buy) and B = E (V |sell).

A = VP(V |buy) + VP(V |buy) (9)

= Vδ(1− µ)

1 + µ(1− 2δ)+ V

(1− δ)(1 + µ)

1 + µ(1− 2δ)(10)

B = VP(V |sell) + VP(V |sell) (11)

= Vδ(1 + µ)

1− µ(1− 2δ)+ V

(1− δ)(1− µ)

1− µ(1− 2δ)(12)

A− B =4(1− δ)δµ(V − V )

1− µ2(1− 2δ)2(13)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 14: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Updating Bids and Asks

After each trade, Bayesian update of beliefs about V .

Idea: How often would we see these trades if V = V vs. V ?

With these ideas, we can update the bid and ask prices.

Expected bid and ask after k buys and ` sells:

Ak+` =

= VP(V |k + 1 buys, ` sells) + VP(V |k + 1 buys, ` sells) (14)

=V δ(1− µ)k+1(1 + µ)` + V (1− δ)(1 + µ)k+1(1− µ)`

(1− δ)(1 + µ)k+1(1− µ)` + δ(1− µ)k+1(1 + µ)`(15)

Bk+` =

= VP(V |k buys, `+ 1 sells) + VP(V |k buys, `+ 1 sells) (16)

=V δ(1− µ)k(1 + µ)`+1 + V (1− δ)(1− µ)k(1 + µ)`+1

(1− δ)(1 + µ)k(1− µ)`+1 + δ(1− µ)k(1 + µ)`+1(17)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 15: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Simulation Example

One simulation for µ = 0.3, δ = 0.5; example bids and asks.

Simple case: V = V = 2 (versus V = 1).

Can see price impact — especially for sequence of orders.

0 10 20 30 40 50

1.4

1.6

1.8

2.0

Time

Price

SBSBBBBSBSBSSBBSBSSBBSSBBBBBBBSBSSBBBBSBSBBSBBBSBB

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 16: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Simulation Averages

Simulate to find the average bid and ask.

10,000 simulations; tried µ = 0.3, 0.5, δ = 0.3, 0.5.

Simple case: V = V = 2 (versus V = 1).

µ=

0.5

0 10 20 30 40 50

1.4

1.6

1.8

2.0

Time

Price

0 10 20 30 40 50

1.4

1.6

1.8

2.0

Time

Price

µ=

0.3

0 10 20 30 40 50

1.4

1.6

1.8

2.0

Time

Price

0 10 20 30 40 50

1.4

1.6

1.8

2.0

Time

Price

δ = 0.3 δ = 0.5

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 17: Microstructure tutorial

UIC ICFD

Glosten-Milgrom Model: Other Results

Basic idea: Spreads exist due to adverse selection.

Buys/sells are unbalanced; but, price series is a martingale.

Orders are serially correlated: buys tend to follow buys.

This and the preceding line seem contradictory.Difference is akin to Pearson ρ versus Kendall τ .

Trades have price impact: a buy increases B and A.

Spreads tend to decline over time as MMs figure out V .

Bid-ask may be such that market effectively shuts down3

If uninformed were price sensitive, spreads would be wider.

Code in THE SECRET DIRECTORY (glosten-milgrom.r).

Fun: Add very rare third trader, govt, who always buys at V .

Stunning: still converging after 50,000 trades.

3We find ourselves in the game-theoretic Paradox of Trade.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 18: Microstructure tutorial

UIC ICFD

Kyle (1985) Model

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 19: Microstructure tutorial

UIC ICFD

One-Period Kyle (1985) Model

Kyle (1985) proposed a model with a single informed trader.

The informed trader:

Considers price impact in setting trade size;Learns security’s terminal value v ; and,Submits order for quantity x .

Liquidity (“noise”) traders submit net order u.

The single market maker (MM):

Observes total order y = x + u;Makes up the difference; and,Sets the market clearing price p.

All trades happen at one price; no bid-ask spread.

All trading occurs in one period.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 20: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Informed Trader vs. MM

The informed trader would like to trade aggressively.

Q1: What sort of function maps v to order size?

A: Linear function? (Yes.)

MM knows larger net orders are more likely to be informed.

Thus MM sets price increasing in net order size.

Q2: What sort of function maps order size to MM’s price?

A: Linear function? (Yes.)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 21: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Setup

Security value v ∼ N(p0,Σ0) (18)

Noise order u ∼ N(0, σ2u) u ⊥⊥ v (19)

MM assumes: informed order x = βv + α (20)

Net order y = x + u (21)

Informed assumes: trade price p = λ︸︷︷︸illiquidity

y + µ (22)

Informed trader profit π = (v − p)x (23)

= (v − λ(x + u)− µ)x (24)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 22: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Optimize, Compute Statistics

If we combine the previous formulæ, we get a little further:

E (π) = E ((v − λ(x + u)− µ)x)︸ ︷︷ ︸E(u)=0;x non-random

= (v − λx − µ)x (25)

x∗ = argmaxx∈R

E (π) =v − µ

2λif λ > 0 (26)

⇒ β =1

2λ, α =

−µ2λ

(27)

E (y) = α + βE (v) =−µ2λ

+p0

2λ(28)

Var(y) = Var(x) + Var(u) = β2 Var(v) + Var(u) (29)

= β2Σ0 + σ2u (30)

Cov(y , v) = Cov(α + βv , v) = βΣ0 (31)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 23: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Find Linear Parameters

Now solve for the linear MM pricing and trader order parameters.

MM earns no expected profit4, prices trade at p = E (v |y).

Since v , y normal, form of E (v |y) is like linear regression.

p = E (v |y) = E (v) +Cov(v , y)

Var(y)(y − E (y)) (32)

= p0 +βΣ0

σ2u + β2Σ0

(y − α− βp0) (33)

Use (33), (27), and (22) to solve for α, β, µ, λ:

α = p0σu√Σ0

; β =σu√Σ0

; µ = p0; λ =

√Σ0

2σu. (34)

4Due to competition, again.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 24: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: MM Price; Informed Order, Profit

MM trade price p = E (v |y) = λy + µ =

√Σ0

2σu· y + p0 (35)

Value uncertainty Var(v |y) =σ2

uΣ0

σ2u + β2Σ0

=Σ0

2(36)

Informed order x∗ = βv + α =(v − p0)σu√

Σ0(37)

Expected profit E (π) = (v − λx − µ)x =(v − p0)2σu

2√

Σ0(38)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 25: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Commentary

What can we learn from the one-period Kyle model?

Trade price linear in net order size, security volatility.

Trade price inverse to noise order volatility.

Informed order linear in security’s deviation from mean.

Expected profit quadratic in security’s deviation from mean.

Large deviations matter much more than small deviations5.

Informed order, expected profit linear in noise order volatility6.

Var(v |y) = Σ02 ⇒ Half of information7 leaks after one trade.

Negative net order (i.e. u < −x) yields negative price. (!)

5Except data errors and adverse selection will hurt you.6Use uninformed orders to hide.7Information in a Fisher sense.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 26: Microstructure tutorial

UIC ICFD

One-Period Kyle Model: Illiquidity Parameter

Finally: Consider the illiquidity parameter.

Illiquidity parameter λ =√

Σ02σu

.√

Σo/σu is ratio of volatilities.

Value uncertainty vs. noise order uncertainty.

λy =√

Σ0y

2σu: like liquidity risk:

Scaled by volatility of security; and,y/σu is similar/proportional to percentage of volume.

Nice: Demanding liquidity has a cost.

Full course covers more such ideas.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 27: Microstructure tutorial

UIC ICFD

Multi-Period Kyle (1985) Model

Kyle also discussed a multi-period model.

Slice time t ∈ {0, 1} into N bins, n = 1, . . . ,N:

Time: ∆tn = 1/N, tn = n/N. (39)

Noise order: ∆un ∼ N(0, σ2u∆tn). (40)

Informed order: ∆xn = βn(v − pn−1)/N. (41)

Price change: ∆pn = λn(∆xn + ∆un). (42)

E(Later profit): E (πn|pt<n) = αn−1(v − pn−1)2 + δn−1 (43)

Competition ⇒ pn = E (v |∆x1 + ∆u1, . . . ,∆xn + ∆un)Informed orders not autocorrelated, by construction.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 28: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Further Definitions

Use the following definitions:

Strategy: X = (x1, . . . , xN). (44)

Pricing rule: P = (p1, . . . , pN). (45)

X chosen to always maximize expected future profit:

E (πn(X ,P)|v , p1, . . . , pn−1) ≥E (πn(X ′,P ′)|v , p1, . . . , pn−1) n = 1, . . . ,N. (46)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 29: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Dynamics Equations

Model dynamics are given by difference equations for n = 1, . . . ,N:

δn−1 = δn + αnλ2nσ

2u∆tn; (47)

αn−1 = 1/(4λn(1− αnλn)); (48)

βn∆tn =1− 2αnλn

2λn(1− αnλn); (49)

λn = βnΣn/σ2u; and, (50)

Σn = (1− βnλn∆tn)Σn−1. (51)

λn is the middle root of the cubic equation:

(1− λ2nσ

2u∆tn/Σn)(1− αnλn) =

1

2. (52)

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 30: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Solving for Dynamics

Solving for the model dynamics is a bit crusty:

1 Guess ΣN (call the guess Σ∗N).

2 Use αN = δN = 0 to get λN =

√Σ∗

N

σu√

2∆tN.

3 Set n = N.

4 Solve for βn and Σ∗n−1.

5 Find αn−1 for λn.

6 Solve (52)8, using middle root for λn−1.

7 n = n − 1; if n > 0, go to step 4.

8 If |Σ∗0 − Σ0| > ε: try another Σ∗N , go to step 1.

9 Solve for β0

8Numerically or via Cardano’s formula.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 31: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Simulation

We can simulate the Kyle model to see its behavior.

Use p0 = 2, Σ0 = 0.4, and σu = 0.5.

Run one simulation. What do we get?

The parameter evolution is not so surprising.

The action evolution is more illuminating.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 32: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Evolution of Parameters I

0 10 20 30 40 50

0.00

0.04

0.08

0.12

Time

delta

0 10 20 30 40 50

0.0

0.1

0.2

0.3

0.4

Time

alpha

0 10 20 30 40 50

05

10

15

20

25

Time

beta

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 33: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Evolution of Parameters II9

0 10 20 30 40 50

1.05

1.10

1.15

1.20

Time

lambda

0 10 20 30 40 50

0.0

0.1

0.2

0.3

0.4

Time

Sigma

9E.B.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 34: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Evolution of Actions

u

u

u

u

u

u

u

u

uu

u u

u

u

u

u

u

u

u

u

u

u

u

u

u

u

u

u u

u

u

u

u

u

u

u

u

u

uuu

u

u

u

u

u

u

u u

u

0 10 20 30 40 50

-0.010

0.000

0.010

Time

Orders

i i i i i i i i i i i i i i i i i i i i ii i i i i i i i i i

i i i i i i i ii i

i i i i i ii i i

0 10 20 30 40 50

2.0

2.1

2.2

2.3

2.4

Time

Tra

de

Price

s

True Price

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 35: Microstructure tutorial

UIC ICFD

Multi-Period Kyle Model: Commentary

A few details nobody has previously noted10:

Informed orders11 are larger after negative uninformed trades.

Informed orders decrease after larger net orders, price moves.

Recall: one leads to the other; confounding lives here.

Informed order size increases slightly with time.

Trade price moves toward the true value.

Trade price may not converge to true value by end of trading.

Code in THE SECRET DIRECTORY (kyle.r).

10As with the Glosten-Milgrom model, I have yet to see plotsfrom anybody else who has simulated the Kyle model.

11Informed trades are shown as ’i’s; uninformed trades as ’u’s.Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 36: Microstructure tutorial

UIC ICFD

If You Want More: to Read

Journals (and associated societies):

Journal of Financial MarketsJournal of Business and Economic Statistics/ASAJournal of Financial Econometrics/SoFiEJournal of Financial EconomicsJournal of Financial and Quantitative AnalysisReview of Financial Studies/SFS

Books:

O’Hara, Market Microstructure TheoryHarris, Trading and ExchangesHasbrouck, Empirical Market MicrostructureWeisberg, Applied Regression AnalysisMontgomery, Design and Analysis of ExperimentsMcCullagh and Nelder, Generalized Linear ModelsBox, Jenkins, Reinsel, Time Series AnalysisOsborne and Rubinstein, A Course in Game Theory

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 37: Microstructure tutorial

UIC ICFD

If You Want More: to Interact With

Seminars (times may change next year)UIC Northwestern U. Chicago

Finance MSCS Finance IEMS Stat E&S Stat FinMath

Fri Wed Wed Tue Wed Thu Mon Fri10:30 4:15 11:00 4:00 11:00 1:20 4:00 4:30

Center Events: UIC ICFD, NWU Zell, UofC Stevanovich

Conferences: ASSA, SoFiE, Oxford-Man Institute

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009

Page 38: Microstructure tutorial

UIC ICFD

If You Want: to Support Work Like This

Talk to academics at the conference; some glad to consult.

Take courses through UIC External Ed:

Market Microstructure and Electronic TradingCommodities, Energy, and Related MarketsFixed Income/Structured ProductsEmpirical Methods for FinanceUnivariate and Mutivariate Time Series Analysis

Donate to the ICFD.

Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009