Professional Documents
Culture Documents
IC Lectures 2015
IC Lectures 2015
Costis Maglaras
I References
market … …
ARCA NASDAQ BATS Dark Pool #1
centers
I Electronic
I Decentralized/Fragmented
NYSE, NASDAQ, ARCA, BATS, Direct Edge, . . .
I Exchanges (∼ 70%)
electronic limit order books (LOBs)
I How should you buy 250,000 shares of IBM stock between 12:30pm and
4:00pm?
– Is this order "large"?
– How fast should you trade? When?
– How much will it cost you?
– Who are you trading against?
I regulatory implications
450
400
Market volume/100
350
Quantity Traded
300
250
200
150
100
50
0
0 30 60 90 120 150 180 210 240 270 300 330 360 390
Time of day (minutes since 9:30am); 5 min bins
8,000
Accumulative Quantity Traded
250
Quantity Traded/100
150
100
50
0
0 20 40 60 80 100 120
Time of day (minutes since 9:30am); 5 min bins
1,800
1,600
1,400
1,200
1,000
800
Market volume/100
600
400
200
0
0 20 40 60 80 100 120
Time of day (minutes since 9:30am); 5 min bins
160
140
120
Quantity Traded
Market volume/100
100
80
60
40
20
0
0 30 60 90 120 150 180 210 240 270 300 330 360 390
Time of day (minutes since 9:30am); 5 min bins; 55% limit order executions
6,000
Accumulative Quantity Traded
5,000
3,000
2,000
1,000
0
0 30 60 90 120 150 180 210 240 270 300 330 360 390
Time of day (minutes since 9:30am); 5 min bins; 55% limit order executions
– volume
– volatility
– bid-ask spread
– market depth
– ...
I real-time market data analytics
I market impact model (more on this tomorrow)
I risk model
– “of the shelf” risk models calibrated using EOD closing price data
do not incorporate intraday correlation structure
– intraday data? (tractable for liquid securities, e.g., S&P500 universe)
– cross-asset liquidity model & market impact model
2.5
Volume Percentages (%)
1.5
0.5
0
0 30 60 90 120 150 180 210 240 270 300 330 360 390
Time of day (minutes since 9:30AM)
3.5
3
2.5
Volatility (%)
2
1.5
1 Illiquid: # 901-1000 by ADV
0
0 6 12 18 24 30 36 42 48 54 60 66 72 78
Time of day (minutes since 9:30AM / 5 min intervals)
40
35
30
Spread (bps)
25
20
15
Illiquid: # 901-1000 by ADV
10
Liquid: top 100 by ADV
5
0
0 6 12 18 24 30 36 42 48 54 60 66 72 78
Time of day (minutes since 9:30AM / 5 min intervals)
100
90
80
Depth (10−4 · ADV)
70
60
50
40
30
20
10
0
0 30 60 90 120 150 180 210 240 270 300 330 360 390
Time of day (minutes since 9:30AM)
US equities, top 100 securities wrt ADV, cross-sectional, intraday depth profile, in
units of 10−4 · ADV.
3
log (depth (10−4 · ADV))
2.5
2
1.5
1
0.5
0
−0.5
0 3 6 9 12 15
Spread (bps)
I Control problem:
I Typical solution:
– Lf (t) = forecast L(t) using k days of HF trading data
– schedule trade according to Lf (t)
– model L(t); filter aggressive trades
– adapt forecast to real time conditions & deviate opportunistically
– incorporate tactical short-term alpha signals (sec to minutes)
I Shortfall S := p̄ − parrival
I Fundamental tradeoff:
– quick execution ⇒ adverse price movement (market impact)
– slow execution ⇒ subject to price risk due to market movement
I Typical solution:
– use a rolling horizon (MPC) control: at t, compute control for [t, T ]
– refine price impact estimates to real time conditions
– adapt trading speed & order placing logic in real-time
– incorporate tactical short-term alpha signals (sec to minutes)
I typical example: principle trading desks; transitions
200
150
100
Implementation Shortfall (bps)
50
0
0 5 10 15 20 25 30
Participation rate (%)
-50
-100
-150
-200
200
150
Implementa1on
Shor6all
(bps)
100
50
Trade
Dura1on
(min)
0
0
50
100
150
200
250
300
350
400
450
-‐50
-‐100
-‐150
-‐200
cancellations
price
cancellations
exchange 1
exchange 2
exchange N
We will discuss LOB dynamics and associated control decisions in days 2-3.
C. Maglaras, 05/2015 – 40 / 228
Overview of algorithmic trading and limit order book markets
exchange 1
I Typical scenario:
10
9
8
7
6
5
4
3
2
1
0
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
Total Volume (million shares)
0.36
0.3
% volume internalized
0.24
0.18
0.12
0.06
0
0 1 2 3 4 5 6 7 8 9 10
log (Quote Size (100 shares))
0.36
0.3
% volume internalizaed
0.24
0.18
0.12
0.06
0
0 2 4 6 8 10 12 14 16 18 20
Spread (bps)
I References
– events:
– limit order arrivals
– trade executions (service completions)
– cancellations
– motivating questions:
– delay estimation & heterogeneous order cancellation behavior
– short-horizon optimal execution in the LOB & microstructure cost model
– adverse selection
– optimal order routing in a fragmented market structure
cancellations
price
cancellations
cancellation rate
µsb sell market order rate
t
pa t pat +1 ··· pN
p1 ··· pbt −1 pb t ··· price
λsN , γ
market
buy .
.
orders .
µbat λsat , γ
. .
. .
. .
λbb , γ µsb
t t
.
.
. market
λb1 , γ sell
orders
limit buy orders limit sell orders
– events:
– limit order arrivals
– trade executions (service completions)
– cancellations
– motivating questions:
– delay estimation & heterogeneous order cancellation behavior
– short-horizon optimal execution in the LOB & microstructure cost model
– adverse selection
– optimal order routing in a fragmented market structure
I Poisson?
I rate fcn’s λ (limit order submissions), µ (trades = service completions)
– time-of-day
– price level, distance from best bid / best ask, spread
– depth, certainly at top of book
– effective tick size
– rates of other flows; large blocks; . . .
1. disregard cancellations
2. timer-based cancellations:
30
25
Event rates (# events/sec)
20
Arrivals
15
10 Cancellations
Trades
5
0
0 100 200 300 400 500
ADV rank
20
10
0
0 100 200 300 400 500
ADV rank
15
Event inter-arrival times (sec)
12
0
0 100 200 300 400 500
ADV rank
2.5
2
log (event inter-arrival times (sec))
Trades
1.5 Cancellations
1 Arrivals
0.5
0
−0.5
−1
−1.5
−2
−2.5
0 100 200 300 400 500
ADV rank
1
Tick period/queueing delay
0.8
0.6
0.4
0.2
0
0 20 40 60 80 100
# trade events per day (1,000’s)
Tick period versus queueing delay: ratio against # trade events. (liquid names)
0.20
0.00
−0.20 y = 0.2745x − 1.4632
−0.40
−0.60
−0.80
−1.00
−1.20
−1.40
−1.60
2 2.5 3 3.5 4 4.5 5 5.5 6
log (# trade events)
−0.10
−0.20 y = 0.2544x − 1.6683
−0.30
−0.40
−0.50
−0.60
−0.70
−0.80
−0.90
−1.00
4 4.5 5 5.5
log (# trade events)
120
Queueing delays (sec)
100
80
60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
ADV rank
120
100
Tick periods (sec)
80
60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
ADV rank
I Event data:
λµ and cancellation flow µ
– events:
– limit order arrivals
– trade executions (service completions)
– cancellations
– motivating questions:
– delay estimation & heterogeneous order cancellation behavior
– short-horizon optimal execution in the LOB & microstructure cost model
– adverse selection
– optimal order routing in a fragmented market structure
– events:
– limit order arrivals
– trade executions (service completions)
– cancellations
– motivating questions:
– delay estimation & heterogeneous order cancellation behavior
– short-horizon optimal execution in the LOB & microstructure cost model
– adverse selection
– optimal order routing in a fragmented market structure
Model:
λ
πn = (1 − ρ)ρn ρ := <1
µ
ρ λ
I Expected number in system E(Q) = = = λE(W )
1−ρ µ−λ
C. Maglaras, 05/2015 – 73 / 228
M/M/1 + M queue (Erlang-A)
n−1 ∞ X
n−1
!−1
Y λ X λ
πn = π0 π0 = 1+
µ + kγ µ + kγ
k=0 n=1 k=0
Cancellation behavior:
I conditional on queue length Q(t), cancellation intensity is uniform across
queue positions x < Q(t)
I variant on cancellations.: residual patience > residual E(waiting time)
(calculation needs queue position)
Liquid securities see significant event volume per minute. Suggests scaling:
λn = nλ and µn = nµ
So:
I arrivals ∼ O(n)
I trades ∼ O(n)
I queue length ∼ O(n):
1 n a.s.
Q̄ n (t) := Q (t) −→ q(t) u.o.c.
n
where q(t) is a deterministic trajectory satisfying
q̇(t) = λ − µ
Scaling:
λn = nλ µn = nµ and γn = γ
q̇(t) = λ − µ − γq(t)
ODE solution:
λ−µ
1 − e −γt + q(0)e −γt
q(t) =
γ
λ−µ
I If λ − µ > 0 (as in trade data), q(t) → =: q∞
γ
q∞ = equilibrium depth (outflow = trades + cancellation = inflow)
I If λ ≤ µ, q(t) → 0.
Scaling: √
λn = n − β n, µn = n (so that λn ≈ µn ),
Flow imbalance:
√ √
N n (t) = (An (t) − S n (t)) = −β nt + σ nB(t) + O(log(nt))
√ √
O( n) stochastic imbalance of Poisson flows, leads to O( n) queue lengths
Q n (t)
Q̂ n (t) := √ =⇒ Q̂(t) = reflected Brownian motion.
n
L(t) = local time at the origin; in LOB analogy, L(t) fires when price moves
Q̂(∞) ∼ exp(−2β/σ 2 )
I queue lengths:
ρn √
E(Q n ) = = O( n)
1 − ρn
√
I waiting times: n queue length, trades arrive at order n, so
1
E(Q n )
E(W n ) = =O √
µn n
I how often does the queue gets depleted: τ n is the length of busy periods
√
E(τ n ) ≈ nE(W n )
C. Maglaras, 05/2015 – 79 / 228
√
Heavy-traffic (diffusion) model: M/M/1 + M, λn − µn = β n
Scaling:
√
λn = n + β n, µn = n and γn = γ
1
Q̂n (t) := √ Q n (t) ⇒ Q̂(t) (reflected O-U process)
n
where
d Q̂(t) = β − γ Q̂(t) dt + σdB(t) + dL(t)
Scaling:
λn = nρ, µn = n and γn = γ (ρ > 1)
√
Q n (t) ≈ nq(t) + n(stochastic fluctuations) + O(log(nt))
– E(W ) = O(1)
– arrival rate fluctuations may yield O(n) variability on order arrival processes
100 1000
80 800
Qn(t)
Qn(t)
60 600
40 400
20 200
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
ρn = 2, n = 100 x 10
4 ρn = 2, n = 1000
10000 10
8000 8
Q (t)
Qn(t)
6000 6
n
4000 4
2000 2
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
20 60
40
10
Qn(t) − n q(t)
Qn(t) − n q(t)
20
0 0
−20
−10
−40
−20 −60
0 20 40 60 80 100 0 20 40 60 80 100
t t
n n
ρ = 2, n = 100 ρ = 2, n = 1000
200 600
400
100
Q (t) − n q(t)
Qn(t) − n q(t)
200
0 0
−200
n
−100
−400
−200 −600
0 20 40 60 80 100 0 20 40 60 80 100
t t
20 200
15 150
Qn(t)
Qn(t)
10 100
5 50
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
n n
ρ = 2, n = 100 x 10
4 ρ = 2, n = 1000
2000 2
1500 1.5
Q (t)
Qn(t)
n
1000 1
500 0.5
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
Qn(t) − n q(t)
5
0 0
−5
−20
−10
−40
−15
0 20 40 60 80 100 0 20 40 60 80 100
t t
n n
ρ = 2, n = 100 ρ = 2, n = 1000
150
400
100
200
Q (t) − n q(t)
Qn(t) − n q(t)
50
0 0
n
−50
−200
−100
−400
−150
0 20 40 60 80 100 0 20 40 60 80 100
t t
8 80
6 60
Qn(t)
Qn(t)
4 40
2 20
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
n n
ρ = 0.999, n = 100 ρ = 0.99968, n = 1000
1000 10000
800 8000
600 6000
Q (t)
Qn(t)
n
400 4000
200 2000
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
40
10 30
Qn(t)
Qn(t)
20
5
10
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
400
100 300
Qn(t)
Qn(t)
200
50
100
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
8 80
6 60
Qn(t)
Qn(t)
4 40
2 20
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
n n
ρ = 0.999, n = 100 ρ = 0.99968, n = 1000
1000 10000
800 8000
600 6000
Q (t)
Qn(t)
n
400 4000
200 2000
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
10
30
8 25
6 20
Qn(t)
Qn(t)
15
4
10
2
5
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
100
300
80 250
60 200
Qn(t)
Qn(t)
150
40
100
20
50
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
4 40
3 30
Qn(t)
Qn(t)
2 20
1 10
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
400 4000
300 3000
Qn(t)
100 1000
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
3 10
Qn(t)
Qn(t)
2
5
1
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
40
30 100
Qn(t)
20 Qn(t)
50
10
0 0
0 20 40 60 80 100 0 20 40 60 80 100
t t
I data analysis:
λµ and cancellations µ
I References
I related questions:
I Proportional cancellations:
1
q(0)γ
w = log 1 +
1
γq(t)
γ µ
w 1 = inf{t ≥ 0 : q(t) = 0}
x(s) = queue position s time units after posting infinitesimal (patient) order
I No cancellations:
q(s) = q(0) − µs
x(s) = queue position s time units after posting infinitesimal (patient) order
I No cancellations:
x(s)
w 1 (x(s)) = , x(0) = q(0)
µ
1
x(s)γ
w 2 (x(s)) = log 1 + x(0) = q(0)
γ µ
Realized limit order delays D u (x axis) compared to delay estimates with proportional cancelations
(blue), or no cancelations (red). Realized delays uncensored (max entropy).
It follows that
q(0) λ
w 2 = inf{t ≥ 0 : x(t) = 0} = · · · = log
η µ
Standardized arrival and cancelation volumes for DJIA stocks - more orders cancel
from small queues, less orders arrive to small queues.
State-dependent cancelations - more orders cancel from small queues. (grey: (can-
cellations in δt intervals) (in shares); red: (cancellations in δt)/Qt )
Observations:
I Event rates increase when queues are small (and likely to get depleted)
– why?
I Intuition:
– when q(t) is small, a cascade of type-2 order cancelations is likely
– when q(t) is large, type-2 orders increase depth and waiting times
(“order crowding”)
λ λ · f 1{q(t)>δ}
γq1 (t)
I cancellation behavior:
– type 1: −γq1 (t) ⇐ ξ ∼ exp(γ)
– type 2: all q2 (t) cancels if q(t) ≤ θ
λ λ · f 1{q(t)>δ}
I ζi (t, u) = type i density at time t of age u
Z y
I qi (t, y ) = ζi (t − u, u)du
0
(type i content at t of age ≤ y )
γq1 (t)
I ζ̇1 (t, u) = −γζ1 (t, u)
ζ1 (t, τ (t))
I α(t) =
ζ1 (t, τ (t)) + ζ2 (t, τ (t)) µ
ζ1 (t, 0) = λ, t > 0
ζ2 (t, 0) = λf 1{q(t)>θ} , t > 0
∂ζ1 (t, u)
= −γζ1 (t, u), t ≥ 0, 0 < u ≤ τ (t)
∂u
ζ2 (t, u) = ζ2 (t − u, 0)1n o , t ≥ 0, 0 < u ≤ τ (t)
min (q(t−v ))>θ
0≤v ≤u
λ λ · f 1{q(t)>δ}
e −γτ (t)
I fraction of trades against type 1 (algo) orders: α(t) =
e −γτ (t) +f
1
λ
I waiting time: τ (t) = log for all t > 0
γ λ − γq1 (t)
λ − γq1 (t)
q̇1 (t) = λ − γq1 (t) − µ
λ(1 + f ) − γq1 (t)
λf λ
I q2 (t) = λf τ (t) = log
γ λ − γq1 (t)
I total queue length is determined by q1 (t):
In steady state:
λf 1 λ
α∗ = 1 − and τ∗ = log
µ γ µ − λf
and
λ(1 + f ) − µ λ − (µ − λf ) λf λ
q1∗ = = , q2∗ = log
γ γ γ µ − λf
C. Maglaras, 05/2015 – 116 / 228
A new formula for delay in a LOB with heterogeneous order flow
1 λ
I w3 = log
γ µ − λf
ṗ1 (t) = −γp1 (t) − α(t)µ and ṗ2 (t) = −(1 − α(t))µ
λ − γq1 (t)
q̇1 (t) = λ − γq1 (t) − µ
λ(1 + f ) − γq1 (t)
λ − γq1 (t)
α(t) =
λ(1 + f ) − γq1 (t)
Waiting times with one-type model w 1 , with no cancelations w 0 , with two-type model w compared to realized
delays D u .
I estimating state- & price-dependent event rates should deal with the
above distinction
I References
cancellations
price
cancellations
cancellation rate
µsb sell market order rate
t
pa t pat +1 ··· pN
p1 ··· pbt −1 pb t ··· price
λsN , γ
market
buy .
.
orders .
µbat λsat , γ
. .
. .
. .
λbb , γ µsb
t t
.
.
. market
λb1 , γ sell
orders
limit buy orders limit sell orders
Main assumptions
I Q(t) → q ∗ as t → ∞
b
λi /γ if 1 ≤ i < b0 , 0
if 1 ≤ i < a0 ,
λbi − µsi λsi − µbi
qi∗,b := if i = b0 , qi∗,s := if i = a0 ,
γ
s γ
0 if b0 < i ≤ N, λi /γ if a0 < i ≤ N,
I Limit orders
- at time t =
0, to the best bid b0 , submit limit orders
+
1 γ
CL = min µsb T− γ
log 1 + µ b0
Q 0 (0) ,C ;
0
- at time t = 0, to the best ask a0 , submit block trade min{C − CL , Qas0 (0)}
;
- for time 0 < t < T , to the best ask a0 , continuously submit trade at rate
κ, or until C is filled;
- at time t = T , clean up with block trade, may deplete multiple queues at
higher price levels.
N−a0
Total cost SL X Ca +k
IS := − p = s/2 − s · + kδ · 0 .
C C C
k=1
Simplifications:
I clean up cost: the number of price levels needed to complete the trade is
+ +
C − SL − Qas0 (0) − κT C − Qas0 (0) − κT
n := ≈
Q̄ s Q̄ s
For large C : IS = α0 + α1 · C + α2 · C 2
n + o
min µsb0 T − Qbb0 (0) ,C
+
δ C − Qas0 (0) − κT δ
IS = s/2 − ·s+ · +
| C
{z } 2 Q̄ s 2
| {z }
limit order benefit higher price level adjustment
- increasing in s, δ
realized trade stats: 5min slices for 2013/7-2013/9, > 1, 800 securities traded
Three quantities not directly observable from data: continuous trading rate κ,
equilibrium queue length Q̄ s , effective tick size δ
I calibration of κ:
1. postulate κ = θ · µ, assume θ is the same on the bid and ask side
2. identify slices that: a) queue length at far side less than 1/3 average
length; b) no price change
3. generate forecast for nominal trading rate µ
4. θ estimated as average ratio of executed quantity to the nominal trading
rate
I Q̄ s approximated by time-averaged queue length at top of the book over each
5min interval
I σ as a proxy for δ
n + o
min µsb0 T − Qbb0 (0) ,C
+
δ C − Qas0 (0) − κT δ
IS = s/2 − ·s+ · +
| C
{z } 2 Q̄ s 2
| {z }
limit order benefit higher price level adjustment
I linear regression:
IS = β0 + β1 · s ∗ + β2 · (R L s ∗ ) + β3 · (R M δ ∗ ) + β4 · δ ∗
n + o
min C , µsb T −Qbb (0)
0 0
- R L := C
+
C −Qas (0)−κT
0
- RM := Q̄ s
(intercept)
coefficient -0.6888*** -0.6941*** -0.5832**
std. error 0.1232 0.1140 0.1076
spread (bps): s ∗
coefficient 0.3187*** 0.3905*** 0.3950***
std. error 0.0069 0.0077 0.0070
limit order: R L s ∗
coefficient -0.3027*** -0.3415*** -0.3658***
std. error 0.0107 0.0100 0.0099
add. tick to pay: R M σ ∗
coefficients 0.0991*** 0.1480*** 0.1486***
std. error 0.0234 0.0225 0.0348
tick size: σ ∗
coefficients 2.3238*** 1.8508*** 2.4290***
std. error 0.1098 0.0997 0.0996
Monthly in-sample linear regression results for microstructure market impact model
- signs of the coefficients are intuitive: limit order −, higher price order +
I Cross-Validation
(our “micro” model)
ν ∗ = β0 + β1 · s ∗ + β2 · R L s ∗ + β3 · R M δ ∗ + β4 · δ ∗
- micro model outperforms the macro benchmark models for all groups
- all models improve as the participation rate increases
deep
- micro model outperforms the macro benchmark models for all groups
- model accuracy improves with queue length
- similar results when segmenting queue lengths in shares and dollars
I applications:
I References
exchange 1
Table 1: Descriptive statistics for the 30 stocks over the 21 trading days of September 2011. All
statistics except the average bid-ask spread were retrieved from Yahoo Finance; the average bid-ask
spread is a time average computed from our TAQ data set. The daily volatility is computed from
closing prices over the period in question.
feeds (i.e., the CTS, CQS, UTDF, and UQDF data feeds). We restrict our attention to the 3005/2015 – 156 / 228
C. Maglaras,
DJIA 30: Expected Queue Lengths – Sept 2011
A
P
A
AC
CS T
CVO
X
D
IS
E
D
PQ
M
C
J
M
FT
O
M D
MM
M K
PFT
E
PG
T
RV
X
Z
XO T
M
JN
CA
V
X
T
A
T
SF
M
R
D
C
C
K
D
IB
JP
M
K
B
A
T
IN
U
M
H
W
(a) Average expected delay across stocks and exchanges.
104
103
102
101
A
P
A
AC
CS T
CVO
X
D
IS
E
D
PQ
M
C
J
M
FT
O
M D
MM
M K
PFT
E
PG
T
RV
X
Z
XO T
M
JN
CA
V
X
T
A
T
SF
M
R
D
C
C
K
D
IB
JP
M
K
B
A
T
IN
U
M
H
W
(b) Average queue length (number of shares at the NBBO) across stocks and exchanges.
Figure 2: Averages of hourly estimates of the expected delays and queue lengths for the Dow 30 stocks
on the 6 exchanges during September 2011. Results are averaged over the bid and ask sides of the
C. Maglaras, 05/2015 – 157 / 228
DJIA 30: Expected Delays – Sept 2011
100
10−1
A
P
A
AC
CS T
CVO
X
D
IS
E
D
PQ
M
C
J
M
FT
O
M D
MM
M K
PFT
E
PG
T
RV
X
Z
XO T
M
JN
CA
V
X
T
A
T
SF
M
R
D
C
C
K
D
IB
JP
M
K
B
A
T
IN
U
M
H
W
(a) Average expected delay across stocks and exchanges.
exchange 1
λ1 market order µ1
exchange 2
λ2 µ2
Λ ?
exchange N
λn µN
X X
max E(Yk |Xk , T )rk − (f + s) · (C − E(Yk |Xk , T )
Xk
k k
where
– Xk = quantity to get posted at exchange K (at top of book – good?)
– Yk = quantity that trades at exchange k up to time T
– simplifying mkt order problem to a clean up trade
– trading algorithms typically not allowed to post more quantity that C
– formulation limit orders are posted at t = 0
X X
max E(Yk |Xk , T )rk − (f + s) · (C − E(Yk |Xk , T )
Xk
k k
despite the many caveats, previous problem captures time vs. money tradeoff
I time: trade now with a market order or sooner in a less congested LOB
I money: trade in a high rebate exchange and also avoid paying the spread
I incentives are such that most institutional flow tries to be patient
study a simpler problem for each trader, but allow many traders to participate
argmin i { ri : Qi > 0, i = 1, . . . , N }
N
X
I W := βi Qi is the workload, a measurement of aggregate available
i=1
liquidity
EDi = Qi /µi =
P
I
j
βj Qj /(µβi ) = W /(µβi )
(π ∗ , W ∗ ) satisfy
N PN !
X
−1 µ− λ
i=1 i
λi + Λ 1 − F (γ0 ) = µ 1−
=⇒ γ0 = F
Λ
i=1
Incentive compatibility:
W∗
max γ(r̃i − r̃0 ) − ≤0 for all γ ≤ γ0
i6=0 µβi
probability
max γr̃i − EDi
i
market order
route to exchange 1
route to exchange 2
route to exchange 3 ···
···
0 γ0 γ1 γ2 γ3
sensitivity γ (delay/$)
24
Estimation procedure:
– Measure µ(s,j)
i (t), µ(s,j) (t) and Qi(s,j)
0 (t)
Table 5: Linear regressions of the expected delays of each security on a particular exchange, versus that
of the benchmark exchange (ARCA).
delay measurements outlined in (25) for all time slots and both sides of the market, i.e., by dividing
C. Maglaras, 05/2015 – 180 / 228
State Space Collapse II – BAC scatter plots
– Var(·) = sample variance, averaged over all time slots t and both sides of
market.
~ t := Q1,t QN,t ~ t := (Q1,t , . . . , QN,t )
ED ,..., or Q
µ1,t µN,t
have a low effective dimension.
I delay: 1st PC (& 2nd PC) explains 83% (90%) of variance on average.
I queue length:
I 1st PC (& 2nd PC) explains 65% (78%) of variance on average.
I less consistent, very low for some names
% of Variance Explained
One Factor Two Factors
Boeing 52% 66%
Caterpillar 31% 51%
Chevron 38% 59%
IBM 27% 53%
United Tech 39% 55%
Exxon Mobil 54% 69%
βbenchmark
EDi,t = · EDbenchmark,t or Qi,t = β · Qbenchmark,t
βi
– offering only one (delay, price) pair is welfare (rev max) optimal
– maxi γri + E(Di ) yields same choice for all agents of they have same γ
I References
– questions
Scaling: √
λn = n − β n, µn = n (so that λn ≈ µn ),
Flow imbalance:
√ √
N n (t) = (An (t) − S n (t)) = −β nt + σ nB(t) + O(log(nt))
√ √
O( n) stochastic imbalance of Poisson flows, leads to O( n) queue lengths
Q n (t)
Q̂ n (t) := √ =⇒ Q̂(t) = reflected Brownian motion.
n
L(t) = local time at the origin; in LOB analogy, L(t) fires when price moves
Q̂(∞) ∼ exp(−2β/σ 2 )
I queue lengths:
ρn √
E(Q n ) = = O( n)
1 − ρn
√
I waiting times: n queue length, trades arrive at order n, so
1
E(Q n )
E(W n ) = =O √
µn n
I how often does the queue gets depleted: τ n is the length of busy periods
√
E(τ n ) ≈ nE(W n )
C. Maglaras, 05/2015 – 194 / 228
√
Heavy-traffic (diffusion) model: M/M/1 + M, λn − µn = β n
Scaling:
√
λn = n + β n, µn = n and γn = γ
1
Q̂n (t) := √ Q n (t) ⇒ Q̂(t) (reflected O-U process)
n
where
d Q̂(t) = β − γ Q̂(t) dt + σdB(t) + dL(t)
Scaling:
λn = nρ, µn = n and γn = γ (ρ > 1)
√
Q n (t) ≈ nq(t) + n(stochastic fluctuations) + O(log(nt))
– E(W ) = O(1)
– pointwise-stationary-fluid-model (PSFM)
The issue:
I for a limit order to get filled, a trader must decide to cross the spread
I that action may convey information about the price (that may move
adversely)
I more likely to get filled by a large trade if at the back of the queue
I large trades often indicate future price movements
So:
I events to keep track (convention: +ve jump pushes price away (no fill)):
P(fill) = P(no jumps in [0, d] or 1st jump occurs in [0, d] and is -ve)
I probability of a fill:
κ− κ+ −dκ
P(fill) = + e
κ κ
κ−
P(adverse fill) = (1 − e −dκ )
κ
and
κ− (1 − e −dκ )
P(adverse fill|fill) =
κ− + κ+ e −dκ
I probability of no fill:
κ+
P(no fill) = (1 − e −dκ )
κ
I above consider a “race” between +ve and -ve jumps over the duration d
I AS often measures price moves within ∆ after fill (similarly)
C. Maglaras, 05/2015 – 204 / 228
Including trading volume considerations & fragmentation
I fragmentation:
I intuitive results:
– side of next price move depends on relative sizes of bid and ask queues
– duration of race depends on d, a function of our queue position
– AS ↓ as Qfr ↓ and as Qbeh ↑
– “ubiquitous” queue imbalance seems to emerge
Symbol Order Value Fill Probability Adverse Selection Order Value at the Front
Model Backtest Model Backtest Model Backtest Model Backtest
(ticks) (ticks) (ticks) (ticks) (ticks) (ticks)
BAC 0.14 0.14 0.62 0.60 0.57 0.57 0.36 0.31
CSCO 0.08 0.07 0.63 0.59 0.68 0.68 0.24 0.21
GE 0.08 0.09 0.62 0.60 0.67 0.65 0.19 0.23
F 0.13 0.15 0.65 0.64 0.60 0.53 0.24 0.23
INTC 0.11 0.09 0.64 0.61 0.63 0.56 0.28 0.23
PFE 0.12 0.11 0.63 0.58 0.62 0.61 0.16 0.21
PBR -0.03 -0.04 0.57 0.53 0.85 0.89 0.03 0.03
EMM 0.07 0.08 0.63 0.63 0.69 0.64 0.21 0.15
EFA 0.03 0.04 0.57 0.53 0.74 0.73 0.06 0.09
– questions
I A. Diffusion model:
√
– O( n) queue lengths
√
– O( n) stochastic fluctuations due to flow imbalance
√
– E(W ) = O(1/ n) and E(τ ) = O(1)
– specifically: queueing delays not visible in diffusion model
(snapshot principle)
– τ random variables depends on queue sizes
√
– cancellations: if proportional to Q, then O( n)
– cancellations: if −ηδt, then O(n) but delay estimates suffer
I B. Pointwise-Stationary-Fluid-Model:
2.5
2
log (event inter-arrival times (sec))
Trades
1.5 Cancellations
1 Arrivals
0.5
0
−0.5
−1
−1.5
−2
−2.5
0 100 200 300 400 500
ADV rank
1
Tick period/queueing delay
0.8
0.6
0.4
0.2
0
0 20 40 60 80 100
# trade events per day (1,000’s)
Tick period versus queueing delay: ratio against # trade events. (liquid names)
0.20
0.00
−0.20 y = 0.2745x − 1.4632
−0.40
−0.60
−0.80
−1.00
−1.20
−1.40
−1.60
2 2.5 3 3.5 4 4.5 5 5.5 6
log (# trade events)
−0.10
−0.20 y = 0.2544x − 1.6683
−0.30
−0.40
−0.50
−0.60
−0.70
−0.80
−0.90
−1.00
4 4.5 5 5.5
log (# trade events)
120
Queueing delays (sec)
100
80
60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
ADV rank
120
100
Tick periods (sec)
80
60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
ADV rank
where an → ∞, an /n → 0 as n → ∞
and p
dλ(t) = α2 (λ̄(t) − λ(t))dt + σ2 λ(t)dB2 (t)
Q(s) → f (λ − µ)
1
Queue process in slow time scale: dQ(t) in terms of (dλ(t) − dµ(t))
γ
(reflected at Q(t) = 0 and re-initialized at depth of bid-1 or ask+1 depths)
I apart from a handful of papers, I have not referenced the econophysics literature on limit
order books
I queueing papers on LOB either focus on descriptive issues or tactical decision making. I
have only referenced a couple of the recent papers that strive to characterize the shape of
the LOB. I have not reviewed most of the literature on double-sided queues, apart from
referencing Kendall’s early paper on the topic.
I I have provided a very limited set of references on stochastic networks. In addition the
book by Chan and Yao could serve as a reference text, introductory texts on "Queueing
systems" could provide background on simple queueing systems such as M/M/1 and the
M/M/1 + M.
I not referenced the extensive OR literature on the "economics of queues" or "queues with
strategic users" that relate to the problems of order placement, order routing, and
cancellation.
I not referenced the literature on PS queues that is related to prorata market structures.
I ...
C. Maglaras, 05/2015 – 219 / 228
References: background on limit order book markets
I Parlour, C.A., Price dynamics in limit order markets. Review of Financial Studies, 1998,
11, 789-816.
I E. Smith, J. D. Farmer, L. Gillemot, S. Krishnamoorthy, Statistical theory of the
continuous double auction, Quantitative Finance, 2003, 3, 481-514.
(good starting point for the “process flow” view of LOB; queueing per se is not in that
paper)
I Parlour, C. and Seppi, D.J., Limit order markets: a survey. In Proceedings of the Handbook
of Financial Intermediation and Banking, edited by A. Thakor and A. Boot, 2008, Elsevier.
(good reference article on LOB, including a short overview of microstructure facts and the
finance literature)
I M. D. Gould, M. A. Porter, S. Williams, M. McDonald, D. J. Fenn, and S. D. Howison.
Limit order books. Quantitative Finance, 13:1709-1742, 2013.
I Ioanid Rosu. A dynamic model of the limit order book. Review of Financial Studies,
22:4601-4641, 2009.
I Kyle, A. S., and A. A. Obizhaeva. 2011. arket Microstructure Invariants: Theory and
Implications of Calibration.orking paper. Available at http://ssrn.com/abstract=1978932.
I Cont, A Kukanov, S Stoikov (2014) The price impact of order book events, Journal of
Financial Econometrics Vol 12, No 1, 47-88
I C. Maglaras, C. Moallemi, H. Zheng (2015), Optimal execution in a limit order book and
an associated microstructure market impact model, working paper, Columbia University.
(the background for slides 123-152)
I Z. Eisler, J. Bouchaud, and J. Kockelkoren. The price impact of order book events: market
orders, limit orders and cancellations. Quantitative Finance, 12(9):1395-1419, 2012.
I C. Moallemi and K. Yuan, A model of queue position valuation, working paper, 2015.
(the motivation and structure of the adverse selection discussion in these slides is based on
Moallemi-Yuan)
I S. Skouras and D. Farmer, The value of queue priority, working paper, 2013.
I B. Biais, F. Declerck, S. Moinas, Fast trading and prop trading, workign paper, 2014.
I D. Jeria and G. Sofianos, Passive orders and natural adverse selection. Goldman Sachs,
Equity Executions Strats, Street Smart, 33, 2008.
Trade scheduling (not including papers on VWAP / TWAP, although some interesting work
exists):
I D. Bertsimas and A. W. Lo. Optimal control of execution costs. Journal of Financial
Markets, 1: 1-50, 1998.
I R. Almgren and N. Chriss. Optimal control of portfolio transactions. Journal of Risk,
3:5-39, 2000.
I R. Almgren. Optimal execution with nonlinear impact functions and trading-enhanced risk.
Applied Mathematical Finance, 10:1-18, 2003.
I G. Huberman and W. Stanzl. Optimal liquidity trading. Review of Finance, 9:165-200,
2005.
I A. Alfonsi, A. Fruth, and A. Schied. Optimal execution strategies in limit order books with
general shape functions. Quantitative Finance, 10:143-157, 2010.
I A. Obizhaeva and J. Wang. Optimal trading strategy and supply/demand dynamics.
Working paper, 2006.
I R. Roll. Orange juice and weather. American Economic Review, pages 861-880, 1984
I L. R. Glosten and P. R. Milgrom. Bid, ask, and transaction prices in a specialist market with
heterogeneously informed traders. Journal of Financial Economics, 14(1):71-100, 1985.
I A. S. Kyle. Continuous auctions and insider trading. Econometrica, 53:1315-1335, 1985
I L. Glosten. Is the electronic limit order book inevitable? Journal of Finance, 49
(4):1127-1161, 1994.
I J. Hasbrouck. Empirical market microstructure: The institutions, economics and
econometrics of securities trading. Oxford University Press, Oxford, 2007.