Sei sulla pagina 1di 38

Market Microstructure

Tutorial
R/Finance 2009

Dale W.R. Rosenthal1

Department of Finance and


International Center for Futures and Derivatives
University of Illinois at Chicago

24 April 2009

UIC ICFD
1
daler@uic.edu
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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, 19934.


Strategist, Equity Derivatives, LTCM, 19952000.
Trader/Researcher, Equity Trading Lab, Morgan Stanley, 2000-3.
Self-employed Trader/Researcher/Coder, Summer 2004.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.

UIC ICFD
2
So you short one stock... omits a lot.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Introduction

Today well 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

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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; Ill skip those.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Glosten-Milgrom (1985) Model

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Glosten-Milgrom Model: Setup

(
V w .p. 1
V
V w .p.
(
Informed w .p.
Trader type T .
Uninformed w .p. 1
Traders take action S (buy/sell from MM), one at a time.
(
buy if V = V
Informed traders: S .
sell if V = V
(
buy w .p. 1/2
Uninformed traders: S .
sell w .p. 1/2

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Glosten-Milgrom Model: Event Trees

1 j5 buy
jjjj
/ sell
3 I ; S =? 0
ggggg

V = V ; T =? WW 1/2 kkk5
{= V
1 {{{
WWW+ kkk
/ sell
{{
1
U; S =?
{{ 1/2
V =?C
CC
CC 0 /
C g3 I ; S =? SSS buy
CC! gg
ggg SS)
1
V V = V ; T =?W sell
WWWW+
1/2
1
U; S =? T / buy
TTTT
) 1/2
t=0 t = 1, 2, . . . sell

V = security value (V , V)
T = trader type (Informed/Uninformed)
S = traders side (buy/sell) UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 ) 1 + (1 2)
= = (2)
2 2
P(sell) = P(sell|V )P(V ) + P(sell|V )P(V ) (3)
(1 + ) + (1 )(1 ) 1 (1 2)
= = (4)
2 2

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Glosten-Milgrom Model: Likelihood of V , V

After one trade, we have information via Bayes Theorem:

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


P(V |buy) = = (5)
P(buy) 1 + (1 2)
P(buy|V )P(V ) (1 )
P(V |buy) = = (6)
P(buy) 1 + (1 2)
P(sell|V )P(V ) (1 )(1 )
P(V |sell) = = (7)
P(sell) 1 (1 2)
P(sell|V )P(V ) (1 + )
P(V |sell) = = (8)
P(sell) 1 (1 2)

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Glosten-Milgrom Model: Bid, Ask, Spread

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


A = E (V |buy) and B = E (V |sell).
A = V P(V |buy) + V P(V |buy) (9)
(1 ) (1 )(1 + )
=V +V (10)
1 + (1 2) 1 + (1 2)
B = V P(V |sell) + V P(V |sell) (11)
(1 + ) (1 )(1 )
=V +V (12)
1 (1 2) 1 (1 2)
4(1 )(V V )
AB = (13)
1 2 (1 2)2

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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+` =
= V P(V |k + 1 buys, ` sells) + V P(V |k + 1 buys, ` sells) (14)
V (1 )k+1 (1
+ )`
+ V (1 )(1 + )k+1 (1 )`
= (15)
(1 )(1 + ) (1 ) + (1 ) (1 + )`
k+1 ` k+1

Bk+` =
= V P(V |k buys, ` + 1 sells) + V P(V |k buys, ` + 1 sells) (16)
V (1 )k (1 + )`+1 + V (1 )(1 )k (1 + )`+1
= (17)
(1 )(1 + )k (1 )`+1 + (1 )k (1 + )`+1
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.
2.0
1.8
Price

1.6

SBSBBBBSBSBSSBBSBSSBBSSBBBBBBBSBSSBBBBSBSBBSBBBSBB
1.4

0 10 20 30 40 50

Time
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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).
2.0

2.0
= 0.5
1.8

1.8
Price

Price
1.6

1.6
1.4

1.4
0 10 20 30 40 50 0 10 20 30 40 50

Time Time

2.0
2.0
= 0.3

1.8
1.8

Price
Price

1.6
1.6

1.4
1.4

0 10 20 30 40 50 0 10 20 30 40 50

Time Time

= 0.3 = 0.5
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.
UIC ICFD
3
We find ourselves in the game-theoretic Paradox of Trade.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Kyle (1985) Model

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 securitys 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.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 MMs price?
A: Linear function? (Yes.)

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
One-Period Kyle Model: Setup

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


Noise order u N(0, u2 ) u v (19)
MM assumes: informed order x = v + (20)
Net order y =x +u (21)
Informed assumes: trade price p = |{z}
y + (22)
illiquidity

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


= (v (x + u) )x (24)

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
One-Period Kyle Model: Optimize, Compute Statistics

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

E () = E ((v (x + u) )x) = (v x )x (25)


| {z }
E (u)=0;x non-random
v
x = argmax E () = if > 0 (26)
xR 2
1
= , = (27)
2 2
p0
E (y ) = + E (v ) = + (28)
2 2
Var(y ) = Var(x) + Var(u) = 2 Var(v ) + Var(u) (29)
2
= 0 + u2 (30)
Cov(y , v ) = Cov( + v , v ) = 0 (31)
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.

Cov(v , y )
p = E (v |y ) = E (v ) + (y E (y )) (32)
Var(y )
0
= p0 + 2 (y p0 ) (33)
u + 2 0

Use (33), (27), and (22) to solve for , , , :



u u 0
= p0 ; = ; = p0 ; = . (34)
0 0 2u

UIC ICFD
4
Due to competition, again.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
One-Period Kyle Model: MM Price; Informed Order, Profit


0
MM trade price p = E (v |y ) = y + = y + p0 (35)
2u
2 0 0
Value uncertainty Var(v |y ) = 2 u 2 = (36)
u + 0 2
(v p0 )u
Informed order x = v + = (37)
0
(v p0 )2 u
Expected profit E () = (v x )x = (38)
2 0

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 securitys deviation from mean.
Expected profit quadratic in securitys deviation from mean.
Large deviations matter much more than small deviations5 .
Informed order, expected profit linear in noise order volatility6 .
0
Var(v |y ) = 2 Half of information7 leaks after one trade.
Negative net order (i.e. u < x) yields negative price. (!)

5
Except data errors and adverse selection will hurt you.
6
Use uninformed orders to hide. UIC ICFD
7
Information in a Fisher sense.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
One-Period Kyle Model: Illiquidity Parameter

Finally: Consider the illiquidity parameter.



Illiquidity parameter = 2u0 .

o /u is ratio of volatilities.
Value uncertainty vs. noise order uncertainty.

y = 0 2y 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.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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, u2 tn ). (40)
Informed order: xn = n (v pn1 )/N. (41)
Price change: pn = n (xn + un ). (42)
2
E(Later profit): E (n |pt<n ) = n1 (v pn1 ) + n1 (43)

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

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 , . . . , pn1 )
E (n (X 0 , P 0 )|v , p1 , . . . , pn1 ) n = 1, . . . , N. (46)

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Multi-Period Kyle Model: Dynamics Equations

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

n1 = n + n 2n u2 tn ; (47)
n1 = 1/(4n (1 n n )); (48)
1 2n n
n tn = ; (49)
2n (1 n n )
n = n n /u2 ; and, (50)
n = (1 n n tn )n1 . (51)

n is the middle root of the cubic equation:


1
(1 2n u2 tn /n )(1 n n ) = . (52)
2

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Multi-Period Kyle Model: Solving for Dynamics

Solving for the model dynamics is a bit crusty:


1 Guess N (call the guess N ).

N
2 Use N = N = 0 to get N = u

2tN
.
3 Set n = N.
4 Solve for n and n1 .
5 Find n1 for n .
6 Solve (52)8 , using middle root for n1 .
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

UIC ICFD
8
Numerically or via Cardanos formula.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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.

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Multi-Period Kyle Model: Evolution of Parameters I

0.12
0.08
delta

0.04
0.00

0 10 20 30 40 50

Time
0.4
0.3
alpha

0.2
0.1
0.0

0 10 20 30 40 50

Time
25
20
15
beta

10
5

UIC ICFD
0

0 10 20 30 40 50

Time

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


Multi-Period Kyle Model: Evolution of Parameters II9

1.20
1.15
lambda

1.10
1.05

0 10 20 30 40 50

Time
0.4
0.3
Sigma

0.2
0.1
0.0

0 10 20 30 40 50

Time

UIC ICFD
9
E.B.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
Multi-Period Kyle Model: Evolution of Actions
u
i i i
0.010
i i i i i
u
i i i i i i i i i i i i i i
i ui i i i i i i i i i i i i i i i i i i i i i ui i i i i u
u u u
u u u uu
Orders

u u u
u u u
0.000

u u
u u u u u
u
uu u u
uu u u
u
uu u u u u u
u u u
u u
-0.010

u
u

0 10 20 30 40 50

Time
True Price
2.4
Trade Prices

2.3
2.2
2.1
2.0

0 10 20 30 40 50
UIC ICFD
Time

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


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).

10
As with the Glosten-Milgrom model, I have yet to see plots
from anybody else who has simulated the Kyle model. UIC ICFD
11
Informed trades are shown as is; uninformed trades as us.
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
If You Want More: to Read

Journals (and associated societies):


Journal of Financial Markets
Journal of Business and Economic Statistics/ASA
Journal of Financial Econometrics/SoFiE
Journal of Financial Economics
Journal of Financial and Quantitative Analysis
Review of Financial Studies/SFS
Books:
OHara, Market Microstructure Theory
Harris, Trading and Exchanges
Hasbrouck, Empirical Market Microstructure
Weisberg, Applied Regression Analysis
Montgomery, Design and Analysis of Experiments
McCullagh and Nelder, Generalized Linear Models
Box, Jenkins, Reinsel, Time Series Analysis
Osborne and Rubinstein, A Course in Game Theory
UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 Fri
10: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

UIC ICFD
Dale W.R. Rosenthal Market Microstructure Tutorial R/Finance 2009
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 Trading
Commodities, Energy, and Related Markets
Fixed Income/Structured Products
Empirical Methods for Finance
Univariate and Mutivariate Time Series Analysis
Donate to the ICFD.

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

Potrebbero piacerti anche