Вы находитесь на странице: 1из 31

What is the limit order book

Model framework

First-passage times

Sample computations

A generalized birth-death stochastic model for high-frequency order book dynamics


Alec Kercheval and He Huang
Department of Mathematics Florida State University

July 31, 2011 Stevens Institute of Technology

What is the limit order book

Model framework

First-passage times

Sample computations

Papers

H. Huang and A. Kercheval, A generalized birth-death

stochastic model for high-frequency order book dynamics. 2011, www.math.fsu.edu/~kercheva/papers/


R. Cont, S. Stoikov, R. Talreja, A stochastic model for

order book dynamics. Operations Research, 2010, 58, 549563.

What is the limit order book

Model framework

First-passage times

Sample computations

Outline
What is the limit order book Model framework Assumptions Continuous time Markov chains First-passage times Generalized birth-death processes The truncated process Sample computations Mid-price up move is rst Execution probability

What is the limit order book

Model framework

First-passage times

Sample computations

Trading in an order-driven market

Three kinds of actions:


limit order to buy (bids) or sell (asks) a specied number of

shares at a specied price


market order to buy or sell a specied number of shares at

best price
cancel a previously placed limit order that has not yet been

executed

What is the limit order book

Model framework

First-passage times

Sample computations

Limit Order Book

A(j) = # limit sell orders (asks) at price j B(i) = # limit buy orders (bids) at price i pA = best ask pB = best bid

A(j+1) A(j) pA

B(i) B(i-1)

pB

What is the limit order book

Model framework

First-passage times

Sample computations

Sample Level II data

Table: A sample of quotes taken from raw data VOD.L. The time-stamp is measured in seconds from midnight, the type B refers to bids, and the level is the number of ticks from best bid (counting from 1 = best bid). Rows appear when an event occurs.

time-stamp 39301.481 39301.722 39302.891 39302.891 39305.192 39308.359

type B B B B B B

level 4 1 4 2 1 4

price 134.9 135.05 134.9 135 135.05 134.9

quantity 203651 10000 193651 192869 9680 186151

What is the limit order book

Model framework

First-passage times

Sample computations

Sample Questions

Given an observed state of the order book, what is the

probability that the next move of the mid-price is upward?


What is the probability that a proposed limit order placed at

best ask will be executed before the mid-price moves downward?

What is the limit order book

Model framework

First-passage times

Sample computations

Model set-up
nite price grid = {1, 2, 3, . . . , n}, allowed prices in

multiples of a tick
Z+ = {0, 1, 2, 3, . . . } = possible numbers of limit orders in

multiples of Sm shares, Sm = avg size of market order


Ask process and Bid process, continuous time Z+ -valued

Markov A(t) = (A1 (t), . . . , An (t))


Ak (t) Bk (t) = 0 all k , t. pA (t) = best ask, pB (t) = best bid price at time t

B(t) = (B1 (t), . . . , Bn(t))

What is the limit order book

Model framework

First-passage times

Sample computations

Model assumptions
market orders and cancellations are constant size Sm . market buy and sell orders arrive at independent,

exponentially distributed times with rate .


cancellations at a distance j ticks from the same-side best

quote arrive at independent, exponentially distributed times with rate proportional to the number of outstanding shares: for kSm shares, the cancellation rate is k j , j, k 0.
limit orders of size k = 1, 2, . . . , M (in multiples of Sm )

arrive at independent, exponentially distributed times with (k ) rate j , where j 1 is tick distance from opposite side best quote.
parameters Sm , , j , and j
(k )

estimated from market data

What is the limit order book

Model framework

First-passage times

Sample computations

Continuous time Markov chains on (Z+ )n


(k )

Ai (t) Ai (t) + k Ai (t) Ai (t) 1 Ai (t) Ai (t) 1 Bi (t) Bi (t) + k Bi (t) Bi (t) 1 Bi (t) Bi (t) 1

at rate at rate at rate at rate at rate at rate

ip (t) B Ai (t)ipA (t) p (t)i A Bi (t)pB (t)i


(k )

for i > pB (t), k 0 for i pA (t) for i = pA (t) > 0 for i < pA (t), k 0 for i pB (t) for i = pB (t) < n + 1

Goal: compute relevant conditional probabilities without

the need for monte carlo simulation

What is the limit order book

Model framework

First-passage times

Sample computations

Continuous time Markov chains on (Z+ )n


(k )

Ai (t) Ai (t) + k Ai (t) Ai (t) 1 Ai (t) Ai (t) 1 Bi (t) Bi (t) + k Bi (t) Bi (t) 1 Bi (t) Bi (t) 1

at rate at rate at rate at rate at rate at rate

ip (t) B Ai (t)ipA (t) p (t)i A Bi (t)pB (t)i


(k )

for i > pB (t), k 0 for i pA (t) for i = pA (t) > 0 for i < pA (t), k 0 for i pB (t) for i = pB (t) < n + 1

Goal: compute relevant conditional probabilities without

the need for monte carlo simulation

What is the limit order book

Model framework

First-passage times

Sample computations

First-passage times of generalized birth-death processes

Let M = 2. Consider X (t), a Z+ -valued Markov process.


X (t) has birth rates (1) and (2) of sizes 1,2, respectively X has death rates i of size 1 at state i 1. b = rst-passage time to state zero given starting state is

b Z+ .
we want to compute the probability density function fb,0 (t)

of b .

What is the limit order book

Model framework

First-passage times

Sample computations

pdf of rst passage time from state 10 to 0

probability density function of the first passage time from state 10 to 0 0.03 pdf

0.025

0.02

probability density

0.015

0.01

0.005

0 0 20 40 60 80 100 t 120 140 160 180 200

What is the limit order book

Model framework

First-passage times

Sample computations

First-passage time to zero

Idea: From state i 2, to reach state i 2 the process must rst reach state i 1. So b = b,b1 + b1,b2 + + 1,0 where i,i1 denotes the rst-passage time from state i to state i 1, for i = 1, 2, . . . b.

What is the limit order book

Model framework

First-passage times

Sample computations

First passage from i to i 1


Let gi (t) be the pdf of i,i1 , fb,0 (t) the pdf of b . Then fb,0 (t) = gb (t) gb1 (t) g1 (t), so
b

b,0 (s) = f
i=1

gi (s)

where denotes the Laplace transform f (s) = f


0

esx f (x)dx

New goal: compute gi (s), and then obtain fb,0 via Inverse Laplace Transform of b,0 f

What is the limit order book

Model framework

First-passage times

Sample computations

Recursive formulas

Let vi = (1) + (2) + i


the dwell time at state i has density vi evi t the next transition is to state i + 1 with probability (1) /vi to state i + 2 with probability (2) /vi to state i 1 with probability i /vi

What is the limit order book

Model framework

First-passage times

Sample computations

Recursive formulas

gi (t) =

(1) i vi evi t + vi evi t gi+1 (t) gi (t) vi vi (2) + vi evi t gi+2 (t) gi+1 (t) gi (t) vi

hence gi (s) = i.e. gi (s) = vi + s i (1) (2) + gi+1 (s)gi (s) + gi+2 (t)gi+1 (s)gi (s) vi + s vi + s vi + s i (2) gi+2 (s)gi+1 (s)

(1) gi+1 (s)

What is the limit order book

Model framework

First-passage times

Sample computations

Recursive formulas

gi (t) =

(1) i vi evi t + vi evi t gi+1 (t) gi (t) vi vi (2) + vi evi t gi+2 (t) gi+1 (t) gi (t) vi

hence gi (s) = i.e. gi (s) = vi + s i (1) (2) + gi+1 (s)gi (s) + gi+2 (t)gi+1 (s)gi (s) vi + s vi + s vi + s i (2) gi+2 (s)gi+1 (s)

(1) gi+1 (s)

What is the limit order book

Model framework

First-passage times

Sample computations

The truncated process X ()

For Z+ , dene X () with state space {0, 1, 2, . . . , } to be X truncated at : X has


birth rates (1) of size 1 and (2) of size 2 at states

i 2
birth rate (1) + (2) of size 1 at state 1 death rates i of size 1 at states i 1.

Trajectories below 2 are the same for X and X () .

What is the limit order book

Model framework

First-passage times

Sample computations

Truncated rst passage times


Let gi (s) be the Laplace transform of the rst-passage time i,i1 of X () from state i to i 1. () g (s) = () g1 (s) = s + 1 () s + (1) + (2) + 1 ((1) + (2) )g (s) i () () () s + (1) + (2) + i (1) gi+1 (s) (2) gi+2 (s)gi+1 (s)
() ()

() gi (s) =

for i = 2, 3, . . . , 1

What is the limit order book

Model framework

First-passage times

Sample computations

Truncated rst passage times


Let gi (s) be the Laplace transform of the rst-passage time i,i1 of X () from state i to i 1. () g (s) = () g1 (s) = s + 1 () s + (1) + (2) + 1 ((1) + (2) )g (s) i () () () s + (1) + (2) + i (1) gi+1 (s) (2) gi+2 (s)gi+1 (s)
() ()

() gi (s) =

for i = 2, 3, . . . , 1

What is the limit order book

Model framework

First-passage times

Sample computations

Convergence of truncated process

Proposition
For each state i, the rst passage time i,i1 converges in
()

probability to i,i1 as . Therefore gi as .


()

(s) converges to gi (s), for all s with [s] > 0,

What is the limit order book

Model framework

First-passage times

Sample computations

Convergence of truncated process

Numerical experiments show the convergence is very rapid as : = 30 is already large enough to make the rst passage times from i = 10 of X () and X indistinguishable to 7 digits with our parameters
= 3.16 (0) = 0.71 0
(1)

= 7.46 = 0.80

(2) 0

What is the limit order book

Model framework

First-passage times

Sample computations

Example: P(mid-price moves up before down)

Assume at t = 0:
There are a orders at best ask pA (0); a = the rst time all

orders at price pA (0) disappear


There are b orders at best bid pB (0); b = the rst time all

orders at price pB (0) disappear


Bid-Ask spread is S ticks
i A is the rst time an ask arrives i ticks away from best bid i B is the rst time a bid arrives i ticks away from best ask,

i = 1, . . . , S 1.

What is the limit order book

Model framework

First-passage times

Sample computations

Direction of the next price move


S1 1 Let B = B B , arrival time of rst bid between

pA (0) and pB (0)


S1 1 Let A = A A , arrival time of rst ask between

pA (0) and pB (0) Both A and B are exponential with rate


S

S =
i=1

(i

(1)

+ i )

(2)

aB = a B and bA = b A we want P[aB bA < 0]

What is the limit order book

Model framework

First-passage times

Sample computations

pdf of aB
aB = a B Let fa , faB be the pdf of a , aB , resp. Then

(s) = a (S + s) + f aB f

S (1 a (S + s)) f S + s

Similarly

(s) = b (S + s) + f bA f

S (1 b (S + s)). f S + s

What is the limit order book

Model framework

First-passage times

Sample computations

pdf of aB
aB = a B Let fa , faB be the pdf of a , aB , resp. Then

(s) = a (S + s) + f aB f

S (1 a (S + s)) f S + s

Similarly

(s) = b (S + s) + f bA f

S (1 b (S + s)). f S + s

What is the limit order book

Model framework

First-passage times

Sample computations

Probability that next move is up

After computing inverse Laplace transforms,


0 0

P[aB bA < 0] =

faB (u)fbA (u z)dudz

What is the limit order book

Model framework

First-passage times

Sample computations

Sample outcomes

Table: Probability that mid-price increases at its next move, (2) (1) = 3.16, (0) = 0.71, 0 = 7.46, 0 = 0.80, Sm = 8127. Column labels indicate the number of initial shares (in multiples of Sm ) at best bid, row labels indicate the number of initial shares at best ask.

a=1 2 3 4

b=1 0.50 0.35 0.30 0.28

2 0.64 0.50 0.43 0.40

3 0.69 0.55 0.50 0.47

4 0.72 0.59 0.53 0.50

What is the limit order book

Model framework

First-passage times

Sample computations

Prob. of executing an ask before price moves down


Table: Probability of executing an ask order at current best ask before the mid-price moves downward, S = 1, when the order size is 1Sm .

a=1 2 3 4

b=1 0.59 0.56 0.54 0.52

2 0.83 0.79 0.77 0.75

3 0.92 0.89 0.87 0.86

4 0.96 0.94 0.93 0.92

Table: Same, when the order size is 2Sm .

a=1 2 3 4

b=1 0.55 0.53 0.52 0.51

2 0.78 0.76 0.74 0.73

3 0.88 0.86 0.85 0.84

4 0.94 0.92 0.91 0.90

What is the limit order book

Model framework

First-passage times

Sample computations

Papers

H. Huang and A. Kercheval, A generalized birth-death

stochastic model for high-frequency order book dynamics. 2011, www.math.fsu.edu/~kercheva/papers/


R. Cont, S. Stoikov, R. Talreja, A stochastic model for

order book dynamics. Operations Research, 2010, 58, 549563.

Вам также может понравиться