Markets: A Rigorous Course

5.7 Optimal execution: Almgren–Chriss

Advanced about 25 min

Motivation

Trading fast reduces exposure to price moves during execution but increases impact; trading slowly does the opposite. Almgren and Chriss (2000) formulate this as a mean–variance problem and solve it in closed form under linear impact. The solution, a sinh⁡\sinh-shaped trajectory, is the backbone of institutional execution algorithms and a clean example of a constrained quadratic optimisation with a linear-recurrence solution.

5.7.1The execution problem#

Setup

Liquidate XX shares over [0,T][0, T] in NN intervals of length τ=T/N\tau = T/N, at times tk=kτt_k = k\tau. Holdings x0=Xx_0 = X, xN=0x_N = 0; the kk-th child order sells nk=xk−1−xkn_k = x_{k-1} - x_k. The unaffected price evolves as

Sk=Sk−1+στ ξk−γ nk,(5.16)S_k = S_{k-1} + \sigma\sqrt{\tau}\,\xi_k - \gamma\, n_k, \tag{5.16}

with ξk\xi_k i.i.d. N(0,1)N(0,1), so σ\sigma is price volatility in ₹ per unit time\sqrt{\text{unit time}}, and γ\gamma is permanent impact (₹ per share sold). The kk-th child order executes at

S~k=Sk−1−εsgn⁡(nk)−ητ nk,(5.17)\tilde S_k = S_{k-1} - \varepsilon\operatorname{sgn}(n_k) - \frac{\eta}{\tau}\,n_k, \tag{5.17}

where ε\varepsilon is a fixed cost (half-spread plus fees) and η\eta the temporary impact coefficient: trading at rate nk/τn_k/\tau shares per unit time costs ηnk/τ\eta n_k/\tau per share, and the effect does not persist. Implementation shortfall is IS=XS0−∑knkS~k\text{IS} = XS_0 - \sum_k n_k\tilde S_k. The trader minimises

U(x)=E[IS]+λVar⁡[IS],λ≥0 the risk aversion.U(x) = E[\text{IS}] + \lambda\operatorname{Var}[\text{IS}], \qquad \lambda \ge 0 \text{ the risk aversion}.

5.7.2The optimal trajectory#

Proposition 5.5Almgren–Chriss, 2000

(a) For any deterministic schedule,

IS=−∑k=1Nστ ξk xk+12γX2+ε∑k∣nk∣+(ητ−γ2)∑knk2,(5.18)\text{IS} = -\sum_{k=1}^{N}\sigma\sqrt\tau\,\xi_k\,x_k + \tfrac12\gamma X^2 + \varepsilon\sum_k|n_k| + \Big(\frac{\eta}{\tau} - \frac{\gamma}{2}\Big)\sum_k n_k^2, \tag{5.18}
Var⁡[IS]=σ2τ∑k=1Nxk2,(5.19)\operatorname{Var}[\text{IS}] = \sigma^2\tau\sum_{k=1}^{N} x_k^2, \tag{5.19}
E[IS]=12γX2+ε∑k∣nk∣+η~τ∑knk2,η~=η−12γτ.(5.20)E[\text{IS}] = \tfrac12\gamma X^2 + \varepsilon\sum_k|n_k| + \frac{\tilde\eta}{\tau}\sum_k n_k^2, \qquad \tilde\eta = \eta - \tfrac12\gamma\tau. \tag{5.20}

(b) If η~>0\tilde\eta > 0 and λ>0\lambda > 0, the unique minimiser of UU over schedules is

xj=X sinh⁡(κ(T−tj))sinh⁡(κT),j=0,…,N,where2τ2(cosh⁡(κτ)−1)=κ~2:=λσ2η~.(5.21)\begin{gathered} x_j = X\,\frac{\sinh\big(\kappa(T - t_j)\big)}{\sinh(\kappa T)}, \quad j = 0,\dots,N, \\ \text{where}\quad \frac{2}{\tau^2}\big(\cosh(\kappa\tau) - 1\big) = \tilde\kappa^2 := \frac{\lambda\sigma^2}{\tilde\eta}. \end{gathered} \tag{5.21}

For λ=0\lambda = 0 the minimiser is the straight line xj=X(1−tj/T)x_j = X(1 - t_j/T) (TWAP).

(c) As τ→0\tau \to 0, κ→λσ2/η\kappa \to \sqrt{\lambda\sigma^2/\eta} and the trajectory converges to the solution of the continuous problem min⁡∫0T(ηx˙2+λσ2x2) dt\min \int_0^T \big(\eta\dot x^2 + \lambda\sigma^2x^2\big)\,dt, x(0)=Xx(0) = X, x(T)=0x(T) = 0:

x(t)=X sinh⁡(κ(T−t))sinh⁡(κT),κ=λσ2/η.(5.23)x(t) = X\,\frac{\sinh\big(\kappa(T - t)\big)}{\sinh(\kappa T)}, \qquad \kappa = \sqrt{\lambda\sigma^2/\eta}. \tag{5.23}
Proof

(a) Iterating (5.16), Sk−1=S0+∑j=1k−1(στξj−γnj)S_{k-1} = S_0 + \sum_{j=1}^{k-1}(\sigma\sqrt\tau\xi_j - \gamma n_j). Then

∑k=1NnkSk−1=XS0+∑k=1Nnk∑j<k(στξj−γnj)=XS0+∑j=1N(στξj−γnj)∑k>jnk=XS0+∑j=1N(στξj−γnj) xj,\begin{aligned} \sum_{k=1}^N n_k S_{k-1} &= XS_0 + \sum_{k=1}^N n_k\sum_{j<k}(\sigma\sqrt\tau\xi_j - \gamma n_j) \\ &= XS_0 + \sum_{j=1}^{N}(\sigma\sqrt\tau\xi_j - \gamma n_j)\sum_{k>j}n_k \\ &= XS_0 + \sum_{j=1}^{N}(\sigma\sqrt\tau\xi_j - \gamma n_j)\,x_j, \end{aligned}

using ∑knk=X\sum_k n_k = X and ∑k>jnk=xj\sum_{k>j} n_k = x_j. With (5.17),

IS=XS0−∑knkSk−1+∑knk(εsgn⁡(nk)+ητnk)=−∑jστξjxj+γ∑jnjxj+ε∑k∣nk∣+ητ∑knk2.\begin{aligned} \text{IS} &= XS_0 - \sum_k n_k S_{k-1} + \sum_k n_k\Big(\varepsilon\operatorname{sgn}(n_k) + \frac{\eta}{\tau}n_k\Big) \\ &= -\sum_j\sigma\sqrt\tau\xi_j x_j + \gamma\sum_j n_j x_j + \varepsilon\sum_k|n_k| + \frac{\eta}{\tau}\sum_k n_k^2. \end{aligned}

For the permanent-impact term, xj−12−xj2=(xj−1−xj)(xj−1+xj)=nj(2xj+nj)x_{j-1}^2 - x_j^2 = (x_{j-1} - x_j)(x_{j-1} + x_j) = n_j(2x_j + n_j), so njxj=12(xj−12−xj2)−12nj2n_jx_j = \tfrac12(x_{j-1}^2 - x_j^2) - \tfrac12 n_j^2. Summing and telescoping, ∑jnjxj=12X2−12∑jnj2\sum_j n_jx_j = \tfrac12X^2 - \tfrac12\sum_j n_j^2. Substituting gives (5.18). The ξj\xi_j are independent with mean 0 and variance 1 and the schedule is deterministic, so (5.19) and (5.20) follow.

(b) For a sell programme with xx non-increasing, ∑k∣nk∣=X\sum_k|n_k| = X, and 12γX2+εX\tfrac12\gamma X^2 + \varepsilon X does not depend on the schedule. So we minimise

F(x1,…,xN−1)=η~τ∑k=1N(xk−1−xk)2+λσ2τ∑k=1N−1xk2,F(x_1,\dots,x_{N-1}) = \frac{\tilde\eta}{\tau}\sum_{k=1}^N(x_{k-1} - x_k)^2 + \lambda\sigma^2\tau\sum_{k=1}^{N-1}x_k^2,

with x0=Xx_0 = X, xN=0x_N = 0. FF is a strictly convex quadratic when η~>0\tilde\eta > 0 (the first sum is a positive definite quadratic form in the interior variables given fixed endpoints, and the second is positive semi-definite), so its unique minimiser is the solution of the first-order conditions. Differentiating with respect to xjx_j, 1≤j≤N−11 \le j \le N-1:

η~τ(2(xj−xj−1)−2(xj+1−xj))+2λσ2τxj=0⟺xj−1−2xj+xj+1=κ~2τ2xj.(5.22)\begin{gathered} \frac{\tilde\eta}{\tau}\big(2(x_j - x_{j-1}) - 2(x_{j+1} - x_j)\big) + 2\lambda\sigma^2\tau x_j = 0 \\ \Longleftrightarrow\quad x_{j-1} - 2x_j + x_{j+1} = \tilde\kappa^2\tau^2 x_j. \end{gathered} \tag{5.22}

This is a linear second-order recurrence with constant coefficients. Trying xj=rjx_j = r^j gives r+r−1−2=κ~2τ2r + r^{-1} - 2 = \tilde\kappa^2\tau^2. Writing r=eκτr = e^{\kappa\tau}, r+r−1=2cosh⁡(κτ)r + r^{-1} = 2\cosh(\kappa\tau), so κ\kappa solves 2(cosh⁡κτ−1)=κ~2τ22(\cosh\kappa\tau - 1) = \tilde\kappa^2\tau^2, which has a unique positive solution κ=τ−1arccosh⁡(1+κ~2τ2/2)\kappa = \tau^{-1}\operatorname{arccosh}(1 + \tilde\kappa^2\tau^2/2). The general solution is xj=Aeκtj+Be−κtjx_j = Ae^{\kappa t_j} + Be^{-\kappa t_j}, equivalently xj=Csinh⁡(κ(T−tj))+Dsinh⁡(κtj)x_j = C\sinh(\kappa(T - t_j)) + D\sinh(\kappa t_j). The boundary condition xN=0x_N = 0 forces D=0D = 0 (since sinh⁡(κT)≠0\sinh(\kappa T) \ne 0), and x0=Xx_0 = X gives C=X/sinh⁡(κT)C = X/\sinh(\kappa T), which is (5.21). The trajectory is strictly decreasing because sinh⁡\sinh is increasing, which confirms the assumption nk>0n_k > 0 used to treat ∑∣nk∣\sum|n_k| as constant. For λ=0\lambda = 0, (5.22) becomes xj−1−2xj+xj+1=0x_{j-1} - 2x_j + x_{j+1} = 0, whose solution with the boundary conditions is linear.

(c) As τ→0\tau \to 0, η~→η\tilde\eta \to \eta, and from cosh⁡(κτ)=1+κ2τ2/2+O(τ4)\cosh(\kappa\tau) = 1 + \kappa^2\tau^2/2 + O(\tau^4) the defining equation gives κ2+O(τ2)=κ~2→λσ2/η\kappa^2 + O(\tau^2) = \tilde\kappa^2 \to \lambda\sigma^2/\eta. Independently, the Euler–Lagrange equation for L=ηx˙2+λσ2x2L = \eta\dot x^2 + \lambda\sigma^2x^2 is ddt(2ηx˙)=2λσ2x\frac{d}{dt}(2\eta\dot x) = 2\lambda\sigma^2 x, i.e. x¨=κ2x\ddot x = \kappa^2 x, with solution (5.23) under the boundary conditions. (The continuous objective is the limit of FF: ητ∑nk2=η∑(nk/τ)2τ→η∫x˙2dt\frac{\eta}{\tau}\sum n_k^2 = \eta\sum(n_k/\tau)^2\tau \to \eta\int\dot x^2dt and σ2τ∑xk2→σ2∫x2dt\sigma^2\tau\sum x_k^2 \to \sigma^2\int x^2 dt.)∎

5.7.3Half-life and the efficient frontier#

Reading the solution

  • κ−1\kappa^{-1} is the trade's half-life scale: with κT≫1\kappa T \gg 1 the holdings decay roughly like e−κte^{-\kappa t}, so most of the order is done within a few multiples of 1/κ1/\kappa.
  • κ2=λσ2/η\kappa^2 = \lambda\sigma^2/\eta: more risk aversion or more volatility means faster trading; more temporary impact means slower.
  • The efficient frontier: as λ\lambda rises from 0, E[IS]E[\text{IS}] rises and Var⁡[IS]\operatorname{Var}[\text{IS}] falls. At λ=0\lambda = 0 the frontier has zero slope, so a small move away from TWAP reduces variance at second-order cost in expectation. Every risk-averse trader should front-load at least a little.
  • In continuous time, for the solution (5.23), E[IS]−12γX2−εX=η∫0Tx˙2dt=ηX2κ2sinh⁡2(κT)(T2+sinh⁡(2κT)4κ)E[\text{IS}] - \tfrac12\gamma X^2 - \varepsilon X = \eta\int_0^T\dot x^2dt = \frac{\eta X^2\kappa^2}{\sinh^2(\kappa T)}\Big(\frac{T}{2} + \frac{\sinh(2\kappa T)}{4\kappa}\Big) and Var⁡=σ2X2sinh⁡2(κT)(sinh⁡(2κT)4κ−T2)\operatorname{Var} = \frac{\sigma^2X^2}{\sinh^2(\kappa T)}\Big(\frac{\sinh(2\kappa T)}{4\kappa} - \frac T2\Big) (Problem 5.10).

5.7.4Liquidating 5 lakh shares in a day#

Worked example

Sell X=5X = 5 lakh shares of a ₹1,500 stock over one trading day (T=1T = 1), in N=13N = 13 slices of about 29 minutes. Daily volatility 1.8%, so σ=₹27\sigma = \text{₹}27 per share per day\sqrt{\text{day}}. Take η=2.5×10−6\eta = 2.5\times10^{-6} ₹ per share per (share/day), so that selling at a rate of 5 lakh shares a day costs η×5×105=₹1.25\eta \times 5\times10^5 = \text{₹}1.25 per share (8.3 bp), and γ=2.5×10−7\gamma = 2.5\times10^{-7} (the whole order moves the price permanently by ₹0.125). Results from ac_trajectory and ac_cost_mean_var:

Risk aversion λ\lambda (per ₹) κT\kappa T First slice Holdings after 6 of 13 slices (t≈0.46t \approx 0.46) E[IS]E[\text{IS}] sd(IS)
0 (TWAP) 0 7.7% 53.8% ₹6.5 lakh (8.7 bp) ₹73.4 lakh (98 bp)
10−810^{-8} 1.71 13.2% 39.5% ₹7.3 lakh (9.7 bp) ₹61.2 lakh (82 bp)
10−710^{-7} 5.37 33.9% 8.4% ₹16.8 lakh (22.4 bp) ₹33.0 lakh (44 bp)
10−610^{-6} 16.07 70.9% 0.1% ₹44.8 lakh (59.7 bp) ₹11.4 lakh (15 bp)

Basis points are of the initial value ₹75 crore. The trade-off is stark: halving the risk from TWAP (98 bp sd to 44 bp) multiplies the expected cost by about 2.6 (8.7 to 22.4 bp). With this volatility, the risk of a slow execution is far larger than its expected cost; which point to choose depends on λ\lambda, i.e. on how much the desk dislikes a bad day relative to an expected cost.

Code Exercise m05_almgren_chriss (in the app: Exercises → m05_almgren_chriss) implements (5.19)–(5.22), and ac_numerical minimises UU directly with scipy.optimize.minimize (BFGS with an analytic gradient). The tests require the closed form and the numerical optimum to agree to 10−610^{-6} of XX for several (λ,N)(\lambda, N), check that λ=0\lambda = 0 gives TWAP, that random perturbations of the closed form always increase UU, that the frontier is monotone, and that with N=4,000N = 4{,}000 the discrete solution matches the continuous one (5.23) to 10−410^{-4}.

Practitioner notes

  • The parameters η\eta, γ\gamma and σ\sigma must be estimated, and impact is concave rather than linear (5.5). Practitioners use the AC structure with a power-law temporary impact and solve numerically, and they re-optimise during the day as prices and volumes arrive.
  • Volume is not uniform. A practical schedule blends the AC urgency with the VWAP volume profile.
  • The model assumes no alpha. If you expect the price to drift against you (you are buying because you expect a rise), add a linear drift term; the optimal schedule becomes more front-loaded (Almgren and Chriss 2000 treat drift as an extension; Problem 5.11 asks you to derive it).

Create a free account

Reading is open to everyone. An account keeps your progress, answers, notes and code drafts, and gives you the study plan, the journals and the simulator. Running code needs an account approved for it.