Professional Documents
Culture Documents
Lillo Imperial Lecture3
Lillo Imperial Lecture3
Lillo Imperial Lecture3
Fabrizio Lillo
https://fabriziolillo.wordpress.com
1 / 85
Outline
References
2 / 85
Market impact of large trades and optimal execution
3 / 85
Market impact of metaorders: phenomenology
4 / 85
The square-root law of price impact
The average relative price change between the first and the last
trade of a metaorder of size Q is well described by the so called
square-root law: r
Q
(Q) = Y
V
Filter 0
Selecting metaorders traded between
~ 28,500,000
Duration F := VP /VD
January 2007 and December 2009
10
Trading day
20
30
40
0 50 100 150 200 250 300 350
Trading minute
Time series of metaorders active on the market for AAPL in the period March-April 2008. Buy
(Sell) metaorders are depicted in blue (red). The thickness of the line is proportional to the
metaorder participation rate. More metaorders in the same instant of time give rise to darker colours.
Each horizontal line is a trading day. We observe very few blanks, meaning that there is almost
always an active metaorder from our database, which is of course only a subset of the number of
orders that are active in the market.
Distribution of the describing variables
104
f (x) = C xa f (x) = C xa
101 103
102
p(F )
p()
100 101
100
C = 0.220 a = -0.932 C = 0.223 a = -0.864
1 1
10 2 1
10
10 10 100 10 6
10 5
10 4
10 3
10 2
10 1
100
F
2
0.6
10 0.0
0.6
3
1.2
10 6 5 4
10 10 10 10 3 10 2
10 1
100
1
10
f () = Y
g() = a log10 (1 + b)
curve).
2
Itmp( = {})
Itmp( = {})
10 10
3 3
10 10
4 4
10 5 4 3 2 1 10
10 10 10 10 10 100 10 5
10 4
10 3
10 2
10 1
100
1 1
10 10
0.00< <0.01 0.00< F <0.03
0.01< <0.06 0.03< F <0.21
0.06< <0.30 0.21< F <1.00
Itmp( = {})
Itmp( = {})
2 2
10 10
3 3
10 10
4 4
10 5 4 3 2 1 0
10 5 4 3 2 1
10 10 10 10 10 10 10 10 10 10 10 100
The price impact surface
Price impact surface: the average relative price change between the
end and the beginning of the execution, conditioning on the
participation rate := Q/VP and the duration F := VP /VD
1.5
2.0 4.0
0
( )
log10()
1.5 1.5
0.0000 0.0000
0.0025 0.0025
2.0 0.0050 2.0 0.0050
0.0075 0.0075
2.5 0.0100 2.5 0.0100
0.5 1.0 1.5 2.0 0.5 1.0 1.5 2.0
log10(F ) log10(F )
I(v| = {, F })
I(v| = {, F })
0.03 0.03
0.015
0.02 0.02
0.010
0.000< F <0.010 0.075< F <0.126 0.000< F <0.010 0.075< F <0.126 0.000< F <0.010 0.075< F <0.126
0.01 0.01
0.005 0.010< F <0.018 0.126< F <0.217 0.010< F <0.018 0.126< F <0.217 0.010< F <0.018 0.126< F <0.217
0.018< F <0.028 0.217< F <0.374 0.018< F <0.028 0.217< F <0.374 0.018< F <0.028 0.217< F <0.374
0.000 0.028< F <0.046 0.374< F <0.631 0.00 0.028< F <0.046 0.374< F <0.631 0.00 0.028< F <0.046 0.374< F <0.631
0.046< F <0.075 0.631< F <1.000 0.046< F <0.075 0.631< F <1.000 0.046< F <0.075 0.631< F <1.000
0.005 0.01 0.01
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
v v v
25
Itmp( = {, T })
sinh k(T t) 15
q(t) = Q
sinh kT
10
p =0.1
k= 2 /a 5 =0.5
=1
0
0 5 10 15 20 25
T
Price dynamics during execution: TIM (propagator)
Continuous-time stock price model for a trader who can move the price of the asset. As long as the
trader is not active, the asset price is determined by the other market participants and follows a
brownian motion.
Z t Z t
S(t) = S(0) + f (q(s))G(t s)ds + (s)dWs
0 0
f (q) = sign(q)|q| Single-trade impact function
Q ( + 1)
q(s) = +1
(D s) G(s) s Memory kernel
V (tc ) D
Measure of front loading: = 0 is a VWAP; >0 (<0) trade more at the beginning (end) of the execution
1.0
0.9
Iren(z)
0.8
0.7
0.6
0.5
1.0 1.5 2.0 2.5 3.0
z
Iren(z| = {, F })
Iren(z| = {, F })
0.8 0.8 0.8
5 / 85
Introduction to optimal execution: a multiscale problem
An investor wants to trade (buy or sell) a given number of shares and wants to
minimize cost by trading incrementally.
6 / 85
Discrete time: Objective function
i.e. the dierence between the cost and the cost in an infinitely liquid market.
7 / 85
Almgren and Chriss
Almgren and Chriss assumed that the price of the stock at step k is equal to the previous
price plus a linear market impact term and a random shock
pk = pk 1 + vk + k IID(0, ). (2)
They consider the eective price pk payed as dierent from the average price pk in the
interval and they model it as
where sign(vk ) S/2 is the contribution from the bid ask spread S and vk represents a
linear temporary impact.
The temporary impact accounts for the resilience of the limit orders in the book, which
relaxes back to the steady state after a trade-induced price movement.
8 / 85
Almgren and Chriss (2)
X 2 N X X N
2
E [C (v)] = X + ( + ) vk + vi vj + S/2 |vk |, (5)
2
k=1 i6=j k=1
PN
under the constraint k=1 vk = X
If one assumes that all vk have the sign of X , the last term becomes constant and equal
to XS/2.
9 / 85
Almgren and Chriss (3)
Given the symmetry, the solution that minimizes the expected impact costs is
T
X X X
v arg min E [C (v)] = , , ..., . (6)
v N N N
showing that the solution simply consists in trading at a constant rate over the periods.
pk = pk 1 + + vk + k IID(0, ). (7)
10 / 85
Almgren and Chriss (4)
The second innovation in Almgren and Chriss is that they consider risk aversion for
optimal execution: they minimize the sum of expected cost and costs risk. By mimicking
the theory on portfolio optimization (Markowitz mean-variance) , Almgren and Chriss
consider as optimal trading schedule the solution of
where is the coefficient of risk aversion. The higher is the , the more important is risk
with respect to cost. A risk neutral investor corresponds to = 0. The set of solutions
to this problem for dierent values of is called optimal frontier.
11 / 85
Almgren and Chriss (5)
12 / 85
Almgren and Chriss (6)
1
The equation found in the original Almgren-Chriss paper is slightly dierent because they define the
temporary impact and the variance as proportional to the interval length = T /N.
13 / 85
Almgren and Chriss (8)
December 2000 December
Almgren/Chriss: Optimal 2000
Execution Almgren/Chriss:
17 Optimal Execution 18
6 5
x 10 x 10
2.5 10
Expected loss E[x] ($)
2 8
C
Share Holdings
1.5 6 B
4
1 A
C 2 A
0.5 B
0 0.5 1 1.5 2 0
0 1 2 3 4 5
Variance V[x] ($2) 12
x 10 Time Periods
The solution of Eq. 12 shows that the more risk averse is the investor (i.e. the higher is
), the more front loaded is the trading schedule. This means that more volume is traded
at the beginning of the execution in order to minimize the uncertainty on execution price
of the last part of the trading schedule.
15 / 85
Optimal execution with transient market impact
16 / 85
Market impact with transient impact
Almgren and Chriss assume a market impact which is linear, fixed, and permanent.
We have seen in the previous lectures that, due to the correlation of the order flow,
market impact is transient, i.e. the past order flow aects future price impacts.
One way of capturing this eect is through the transient impact model (TIM)
TIM assumes that
1
X X
pn = p 1 + f (vn k )G (k) + k (14)
k=1 k
The decay of G is such that prices are diusive (or approximately efficient) given the
correlated order flow
Efficiency leads to
pn+1 pn = K (vn vn ) + n (16)
where vn is the best predictor of vn given Fn .
17 / 85
The propagator model in real time
Figure: Impact (top) and propagator (bottom) from 5 min imbalance data
19 / 85
Market impact at dierent aggregations (# of trades)
3 10
x 10 x 10
2 6
N=1 N=1
N=8 N=8
0 N=64 N=64
4 N=512
2
2
R/V*N
0
R
6
2
8
4
10
6
12 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5
6 4 2 0 2 4 6
V 6 V/V*N
x 10
Market impact is a strongly concave function of volume at short scales, but becomes
progressively more linear on longer scales (Bouchaud, Farmer, Lillo, 2009)
20 / 85
Propagator in aggregated real time
We computed the propagator G (k) over 5 min intervals by linear regression
The TIM fits data quite well also on aggregated (time or trades) data.
21 / 85
Optimal execution
22 / 85
Optimal execution with TIM
23 / 85
Solution
h i N
X k 1
X
Var [c(v)] = E (c(v) E [c(v)])2 = E [( vk j ) 2 ] =
k=1 j=0
N
X N
X N X
X N X
= E [( k vj )2 ] = 2
( vj )2 = Vk,j vk vj . (29)
k=1 j=k k=1 j=k k,j
where 2 is the variance of the residuals. The variance of the cost is a bilinear form.
We define F I + V. By using again Lagrange multipliers, we have therefore the
optimal trading schedule
1 X 1
v? = z F 1= F 1. (30)
1T F 1 1
25 / 85
Including the risk term
More risk aversion leads to more trading at the beginning of the program
26 / 85
Optimal execution: calibration on real data (no risk aversion)
The optimal execution for a buy trade includes buys and sells !!
The cost is positive (no price manipulation), but transaction triggered price
manipulation.
Well see later conditions leading to this result.
27 / 85
Including spread costs (no risk aversion)
In this derivation we have neglected any cost term related to trading (fees, spread).
While fixed and proportional fees do not aect the qualitative properties of the results,
spread costs change them significantly.
The model for price becomes
n
X
pn = p0 + [k + f (vk )G (n k)] + sign(vk ) k , (31)
k=0
where D = ({ k })T is a vector describing the spread cost during execution. We assume
for simplicity that D = 1
The absolute value prevents an analytical solution and we use numerical optimization.
The shape of the solution does not qualitatively change.
28 / 85
Optimal execution: calibration on real data with spread (no risk aversion)
Figure: Spread costs regularize the solution (no sells for a buy program)
29 / 85
Comments
The alternating (buy-sell) solution and the regularization achieved by the bid ask
term is similar to what happens in portfolio optimization.
By choosing a parameter much smaller than the fractional spread, one still
recovers the U-shaped solution.
30 / 85
Efficient frontier
31 / 85
Optimal execution in real time
32 / 85
Problem setting
XT + = 0
33 / 85
Key quantities
Revenues Z T
RT (X ) = StX dXt (34)
0
Liquidation costs
CT (X ) = X0 S00 RT (X ) (35)
34 / 85
Predoiu, Shaikhet and Shreve
If the cost depends on the stock price only through the term
Z T
St dXt (36)
0
There is no longer a source of randomness. We may restrict the search for an optimal
35 / 85
Price manipulation
Definition
A round trip is an order execution strategy X with X0 = XT = 0. A price manipulation
strategy is a round trip with
E [RT (X )] > 0 (38)
It is not possible to open and close a position with a positive expected profit
36 / 85
Transaction-triggered price manipulation
Definition
(Alfonsi et al 2012). A market impact model admits transaction-triggered price
manipulation if the expected revenues of a sell (buy) program can be increased by
intermediate buy (sell) trades. In other words, 9X0 , T > 0, X , such that
Definition
A market impact model has negative expected liquidation costs if
37 / 85
Relation between manipulations
Proposition
(Klock et al 2011)
Any market impact model that does not admit negative expected liquidation costs
does also not admit price manipulation.
Suppose that asset prices are decreased by sell orders and increased by buy orders.
Then the absence of transaction-triggered price manipulation implies that the model
does not admit negative expected liquidation costs. In particular, the absence of
transaction-triggered price manipulation implies the absence of price manipulation in
the usual sense.
38 / 85
The Almgren-Chriss model
St0 = S0 + Wt (42)
39 / 85
The Almgren-Chriss model
Proposition
(Huberman and Stanzl 2004, Gatheral 2010). If the Almgren-Chriss model does not
admit price manipulation, then g (x) = x with 0
This means that non-linear permanent market impact is inconsistent with the principle of
no price manipulation.
40 / 85
Almgren-Chriss with linear permanent impact
Proposition
If g (x) = x and f is convex, then the strategy vt = X0 /T maximizes the expected
revenues.
41 / 85
Euler-Lagrange solution of the Almgren-Chriss model and linear permanent
impact
42 / 85
Optimal execution in the Almgren-Chriss model (with risk)
Xt Xt = 0 (53)
with solution s
sinh((T t)) 2
Xt = X0 = (54)
sinh T
43 / 85
Transient impact models
44 / 85
Obizhaeva-Wang model
45 / 85
Obizhaeva-Wang model:solution
This is a Fredholm integral equation of the first kind, whose exact solution is
46 / 85
Generalization?
Proposition
If temporary market impact decays exponentially, price manipulation is possible unless
f (v ) / v
47 / 85
Linear case
Proposition
(Bochner Theorem) C (X ) 0 if and only of G (|x|) can be represented as the Fourier
transform of a positive finite Borel measure on R, i.e.
Z
G (|x|) = e ixz (dz) (64)
48 / 85
Linear case: solution
Theorem
Suppose G is positive definite. Then X minimizes C (X ) if and only if 9 such that Xt
solves 8t Z T
G (|t s|)dXs = (65)
0
1
and thus C (X ) = 2
X0 .
and Z
T 1+
p T 2
X0 = vs ds = B (67)
0 2 1+ 2
49 / 85
Linear case: transaction-triggered price manipulation
Theorem
Rt
Suppose G is convex, satisfies 0 G (t)dt < 1, and there is an admissible strategy. Then
there exists a unique admissible optimal strategy Xt which is monotone, i.e. there is no
transaction-triggered price manipulation.
Examples:
1
G (t) = (1+t)2
is convex, no transaction triggered price manipulation
1
G (t) = is concave around zero, the optimal soultion displays transaction
(1+t 2 )
triggered price manipulation
50 / 85
Non-linear transient impact
with Z T
vt dt = X0 (69)
0
Theorem
(Gatheral 2010): If G (t) is finite and continuous at t = 0 and f is nonlinear, then there
is price manipulation
51 / 85
A special, yet important, class
Theorem
(Gatheral 2010). If G (t) = t with 2 (0, 1) and f (x) / |x| sign(x) with > 0, then
price manipulation exists when one of the two following conditions is verified:
log 3
+ 1 =2 ' 0.415 (72)
log 2
52 / 85
A special, yet important, class
c X0 +1 1
C VWAP = T (73)
(1 )(2 ) V
and the impact is
c X0
E [ST S0 ] = T1 (74)
1 V
Interestingly, if + = 1 the expected impact and cost do not depend on the
execution time.
If = = 0.5, the impact is
r r
X0 p X0
E [ST S0 ] = 2c = 2c Td (75)
V ADV
which is the celebrated square root impact formula
53 / 85
Transforming the cost minimization into an integral equation
Dang (2014) shows that, given f 2 C 1 (R) and G 2 L1 [0, T ], for the class of
functions x on [0, T ] satisfying
x is absolutely continuous on (0, T ),
f v 2 L1 [0, T ],
the following necessary condition for the stationarity of the cost functional holds:
Z t Z T
f (v (s)) G (t s) ds + f 0 (v (t)) v (s) G (s t) ds = , (76)
0 t
54 / 85
Integral equation
where (
f (v (s)) , st
F (v (s) , t) = (78)
v (s) f 0 (v (t)) , s > t,
56 / 85
The linear case
In the linear case, f (v ) = v , the integral equation becomes a Friedholm integral equation
of the Abel type, which can be solved analytically as we have seen above:
c
v (t) = 1 , (79)
[t (T t)] 2
57 / 85
Perturbative approach
2.6
2.8
linear
log10 volume 3
weaknonlinear
3.2
3.4
3.6
3.8
4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
Figure: Solution of the weak nonlinear Fredholm integral equation for = 0.5, = 0.02 and
X = 0.1. The full line represents the solution v (s) = u (s) + w (s). The solution is not
symmetric for time reversal. The dotted line represents the GSS solution, i.e. the solution valid
for the linear impact case.
We solve the integral equation by means of the Discrete Homotopy Analysis Method
(DHAM), i.e. as a continuous transformation of a given solution (never crossing
v = 0)
Given the following general equation
N [v (t)] = 0, (81)
we construct the so-called zero-order deformation equation
h i
(1 p) L (t; p) v 0 (t) = p } H (t) N [ (t; p)] , (82)
where
1 @ m (t; p)
v m (t) = . (85)
m! @p m p=0
59 / 85
Homotopy Approach for market impact
The operator is
Z T
N [v (t)] = + G (|t s|) F (v (s), t) ds . (86)
0
Choosing L and H(t) as the identity operators, the zero-order deformation equation
is h i
(1 p) (t; p) v 0 (t) = } p N [ (t; p)] . (87)
(89)
60 / 85
Discrete Homotopy Approach: Results
3
1 12 x 10
v 0 = GSS
1.5 v1
10
2 v2
8 v3
2.5 v4
v5
volume
log10 E 7
3 6
v6
3.5 4 v7 !
v= vi
4
2
4.5
0
5
5.5 2
100 50 0 0 0.5 1
h time
Figure: The logarithm of the squared residual E 7 (}) is illustrated on the left panel, the minimum
is attained for } = 55.7 where we have E 7 = 3.2 10 6 . The GSS guess and the DHAM
solution are reported on the right panel respectively by a full green line with circles and a dashed
blue line with circles, are reported also the results of the seven deformation equations. 61 / 85
Discrete Homotopy Approach: Costs
Table: Costs for three dierent strategies, VWAP, GSS, and DHAM, in the no-dynamic-arbitrage
region for = 0.45, 0.5. The numbers in boldface are those achieving the smallest cost. The
dierence between costs increases with the degree of non-linearity, i.e. < 1. In this case we use
a GSS initial guess to obtain the DHAM solution.
The DHAM solution has a cost up to 20% smaller than the GSS, while the latter has a
cost which is only 1% smaller than the VWAP
62 / 85
Fully numerical solutions
N X
X N N
X NX
arg min vin f vjn Aij s.t. vi = (90)
i=1 j=1 i=1
T
where the Aij are elements of a Toeplitz matrix that describes the decay kernel G (t s)
Aij = 0; j > i,
2
1 T
Aii = ;
(1 ) (2 ) N
2 n o
1 T
Aij = (i j + 1)2 2 (i j)2 + (i j 1)2 ; j i
(1 ) (2 ) N
63 / 85
Fully numerical solution: A N = 2 period motivating example
Let us consider the case of a buy program over N = 2 periods
0.05
0.04
0.03
0.02
0.01
0.2 0.15 0.1 0.05 0 0.05 0.1 0.15 0.2
v1
Figure: Cost function C [v1 , 2X v1 ] for X = 0.1, = 0.5. For = 1 the minimum is at v1 = X .
In the nonlinear case there are two local minima.
65 / 85
Optimal strategies with the constraint v 0
66 / 85
The unconstrained optimal solution for a buy program
0.03
= 0.5, = 0.5 = 0.45, = 0.55
0.04
0.025
0.02 0.03
volume
volume
0.015
0.02
0.01
0.01
0.005
0 0
0 0.5 1 0 0.5 1
time time
Figure: Optimal solution given by the SQP-algorithm for a buy-program where X = 0.1, i.e. 10%
of a unitary market volume. We report the volume to be traded in each interval of time.
Under strong non-linearity, the optimal buy program is composed by few intense buying
periods interspersed by long weak selling periods
For strong nonlinearity ! Negative costs!! ! Possibility of price manipulation
67 / 85
Price manipulation and its regularization
where V = XM /T is the market volume per unit time. This is concave for small v and
convex for large v (illiquidity wall)
Both regularization succeed (in some parameter regime) to avoid negative costs
68 / 85
Spread regularization
0.035
0.02
r = 50% 0.03 r = 10%
0.025
0.015
0.02
volume
volume
0.01 0.015
0.01
0.005 0.005
0
0
0.005
0 0.5 1 0 0.5 1
time time
Figure: Optimal solution given by the SQP algorithm for a buy-program where X = 0.1, i.e. 10%
of a unitary market volume, in presence of a spread cost for = 0.45 and = 0.55. The
liquidation cost is CSQP = 0.026 for large spread cost (left) and CSQP = 5.9 10 3 for small
spread cost (right).
The larger the spread, the stronger the regularization, the smaller the contribution from
sell trades
69 / 85
Concave-convex impact
4.5
4 d = 0.1
3.5
d = 0.5
3
d=1
fG (v)
2.5
1.5
0.5
0
0 0.25 0.5 0.75 1 1.25 1.5
v
3 3
3 x 10 x 10
d=2 d=1
4
volume
volume
2
1 2
0 0
0 0.5 1 0 0.5 1
3 3
6 x 10 15
x 10
d = 0.5 d = 0.1
volume
volume
4 10
2 5
0 0
0 0.5 1 0 0.5 1
time time
J.P. Bouchaud, J. D. Farmer, and F. Lillo, How markets slowly digest changes in supply
and demand, in T. Hens and K.R. Schenk-Hoppe (editors), Handbook of Financial
Markets: Dynamics and Evolution, 57-160 (2009).
F. Lillo J. D. Farmer and R. N. Mantegna, Master curve for the price-impact function,
Nature 421,129-130 (2003).
F.Lillo and J.D. Farmer, The long memory of efficient market. Studies in Nonlinear
Dynamics and Econometrics 8, 1 (2004).
F. Lillo, S. Mike e J. Doyne Farmer, Theory for long memory in supply and demand.
Physical Review E 71, 066122 (2005).
E. Moro, J. Vicente, L.G. Moyano, A. Gerig, J.D. Farmer, G. Vaglica, F. Lillo, R. N.
Mantegna, Market impact and trading profile of hidden orders in stock markets. Physical
Review E 80, 066102 (2009).
E. Busseti and F. Lillo, Calibration of optimal execution of financial transactions in the
presence of transient market impact, J. Stat. Mech. P09010, 2012.
J. D. Farmer, A. Gerig, F. Lillo, H. Waelbroeck, How efficiency shapes market impact
Quantitative Finance 13, 1743-1758 (2013).
D. E. Taranto, G. Bormetti and F. Lillo, The adaptive nature of liquidity taking in limit
order books. J. Stat. Mech., doi:10.1088/1742-5468/2014/06/P06002 (2014)
B. Toth, I. Palit, F. Lillo, J. D. Farmer, Why is equity order flow so persistent?, Journal of
Economic Dynamics & Control 51 (2015) 218-239
84 / 85
Bibliography (II)
E. Zarinelli, M. Treccani, J.D. Farmer, F. Lillo. Beyond the square root: Evidence for
logarithmic dependence of market impact on size and participation rate, Market
Microstructure and Liquidity 1, 1550004 (2015)
G. Curato, J. Gatheral, F. Lillo, Optimal execution with nonlinear transient market impact,
Quantitative Finance, (in press 2016)
G. Curato, J. Gatheral, F. Lillo, Discrete homotopy analysis for optimal trading execution
with nonlinear transient market impact, Communications in Nonlinear Science and
Numerical Simulation, 39, 332 342 (2016)
D. E. Taranto, G. Bormetti, J.-P. Bouchaud, F. Lillo, B. Toth, Linear models for the impact
of order flow on prices I. Propagators: Transient vs. History Dependent Impact,
http://arxiv.org/abs/1602.02735 (2016)
D. E. Taranto, G. Bormetti, J.-P. Bouchaud, F. Lillo, B. Toth, Linear models for the impact
of order flow on prices II. The Mixture Transition Distribution model,
http://arxiv.org/abs/1604.07556 (2016)
Jim Gatheral, Alexander Schied, Dynamical models of market impact and algorithms for
order execution, in Handbook of Systemic Risk (J.-P. Fouque and J. A. Langsam editors),
Cambridge University Press 2013.
85 / 85