Market MicrostructureOptimal ExecutionMarket ImpactStochastic ControlAlmgren-Chriss

Almgren-Chriss Optimal Execution

Module 3 of 425 min readLevel: Hard

Setup

The Execution Problem

A portfolio manager needs to sell XX shares of a stock over a time horizon [0,T][0, T]. Selling too fast incurs large market impact costs (moving the price against themselves). Selling too slowly leaves the position exposed to price risk for longer. This is the optimal execution problem: find a trading schedule that balances market impact against timing risk.

This is a ubiquitous problem in practice: unwinding a large position post-trade decision, rebalancing a portfolio after a factor model update, or executing a delta hedge for a large options position. The Almgren-Chriss (2001) framework is the standard model for this problem on institutional trading desks.

Conventions and Assumptions

  • Initial position: X>0X > 0 shares to sell, X0=XX_0 = X.
  • Time grid: discrete times 0=t0<t1<<tN=T0 = t_0 < t_1 < \cdots < t_N = T with equal spacing τ=T/N\tau = T/N.
  • Shares sold in period kk: nk=Xk1Xk0n_k = X_{k-1} - X_k \geq 0 (non-negative, selling only).
  • Trade rate: vk=nk/τv_k = n_k / \tau (shares per unit time).
  • Mid-price dynamics in the absence of trading: Sk0=Sk10+στξkS_k^0 = S_{k-1}^0 + \sigma\sqrt{\tau}\, \xi_k where ξki.i.d.N(0,1)\xi_k \stackrel{\text{i.i.d.}}{\sim} \mathcal{N}(0,1).
  • Volatility σ\sigma: annualised. Daily vol is σ1/252\sigma\sqrt{1/252} for equities.
  • Rates are zero (P&L is measured in dollar terms, no discounting).

Market Impact Model

Permanent and Temporary Impact

Almgren-Chriss decompose market impact into two components:

Permanent impact: trades shift the mid-price permanently. Every share sold at time kk reduces the mid-price for all future periods. The cumulative permanent impact of selling n1,,nkn_1, \ldots, n_k shares is:

ΔSkperm=g ⁣(nkτ)τ=g(vk)τ,\Delta S_k^{\mathrm{perm}} = -g\!\left(\frac{n_k}{\tau}\right) \cdot \tau = -g(v_k)\cdot\tau,

where g(v)g(v) is the permanent impact function (shares per time → price change). For the linear model: g(v)=γvg(v) = \gamma v, so selling at rate vv permanently moves the price by γvτ-\gamma v \cdot \tau per period.

Temporary impact: the execution price in period kk differs from the (already impacted) mid by an additional amount due to consuming liquidity immediately. This cost is paid once and does not affect future mid-prices:

Pkexec=S~kh ⁣(nkτ),P_k^{\mathrm{exec}} = \tilde{S}_k - h\!\left(\frac{n_k}{\tau}\right),

where S~k\tilde{S}_k is the mid-price at time kk (already shifted by permanent impact), and h(v)h(v) is the temporary impact function. For the linear model: h(v)=ϵsgn(v)+ηvh(v) = \epsilon\, \mathrm{sgn}(v) + \eta v, where ϵ\epsilon is a fixed half-spread cost and ηv\eta v is the linear temporary impact.

The Full Price Process

Let S~k\tilde{S}_k be the mid-price after permanent impact. Starting from S0S_0:

S~k=S0+στj=1kξjγj=1knj.\tilde{S}_k = S_0 + \sigma\sqrt{\tau}\sum_{j=1}^k \xi_j - \gamma \sum_{j=1}^k n_j.

The total proceeds from selling XX shares:

Proceeds=k=1NnkPkexec=k=1Nnk ⁣[S~kh(nk/τ)].\mathrm{Proceeds} = \sum_{k=1}^N n_k P_k^{\mathrm{exec}} = \sum_{k=1}^N n_k \!\left[\tilde{S}_k - h(n_k/\tau)\right].

The shortfall (cost of execution relative to the decision price S0S_0):

IS=S0XProceeds=γk=1Nnkj=1knjpermanentimpact+ηk=1Nnk2τtemporaryimpact+στk=1Nnkj=1kξjtimingrisk.\mathrm{IS} = S_0 X - \mathrm{Proceeds} = \underbrace{\gamma \sum_{k=1}^N n_k \sum_{j=1}^k n_j}_{\mathrm{permanent\,impact}} + \underbrace{\eta \sum_{k=1}^N \frac{n_k^2}{\tau}}_{\mathrm{temporary\,impact}} + \underbrace{\sigma\sqrt{\tau}\sum_{k=1}^N n_k \sum_{j=1}^k \xi_j}_{\mathrm{timing\,risk}}.

The first two terms are deterministic costs; the last is random (timing risk from mid-price moves while the position is open).


Theory: Optimal Execution

Objective Function

Almgren-Chriss optimise the mean-variance objective over the implementation shortfall:

U=E[IS]+λ2Var[IS],U = \mathbb{E}[\mathrm{IS}] + \frac{\lambda}{2} \mathrm{Var}[\mathrm{IS}],

where λ0\lambda \geq 0 is the risk-aversion parameter (units: inverse variance, or equivalently, the penalty per unit of variance). Large λ\lambda penalises timing risk heavily, favouring fast execution; small λ\lambda accepts more risk in return for lower market impact costs.

Expected shortfall:

E[IS]=γk=1Nnkj=1knj+ητk=1Nnk2=γ2X2+ητk=1Nnk2,\mathbb{E}[\mathrm{IS}] = \gamma \sum_{k=1}^N n_k \sum_{j=1}^k n_j + \frac{\eta}{\tau} \sum_{k=1}^N n_k^2 = \frac{\gamma}{2}X^2 + \frac{\eta}{\tau}\sum_{k=1}^N n_k^2,

using the identity knkj=1knj=12[(knk)2+knk2]12knk2\sum_k n_k \sum_{j=1}^k n_j = \frac{1}{2}\bigl[(\sum_k n_k)^2 + \sum_k n_k^2\bigr] - \frac{1}{2}\sum_k n_k^2 and noting knk=X\sum_k n_k = X. The first term is a constant (independent of schedule), so minimising expected shortfall alone reduces to minimising knk2\sum_k n_k^2, which favours spreading trades as evenly as possible (TWAP).

Variance of shortfall:

Var[IS]=σ2τk=1NXk2,\mathrm{Var}[\mathrm{IS}] = \sigma^2 \tau \sum_{k=1}^N X_k^2,

where Xk=Xj=1knjX_k = X - \sum_{j=1}^k n_j is the remaining inventory after period kk. This follows because the timing risk is στknkj=1kξj=στjξjXj\sigma\sqrt{\tau}\sum_k n_k \sum_{j=1}^k\xi_j = \sigma\sqrt{\tau}\sum_j \xi_j X_j, and the ξj\xi_j are independent.

Continuous-Time Formulation

In continuous time with selling rate v(t)v(t) (shares per unit time):

E[IS]=γ2X2+η0Tv(t)2dt,\mathbb{E}[\mathrm{IS}] = \frac{\gamma}{2}X^2 + \eta\int_0^T v(t)^2\, dt,

Var[IS]=σ20Tx(t)2dt,\mathrm{Var}[\mathrm{IS}] = \sigma^2 \int_0^T x(t)^2\, dt,

where x(t)=X0tv(s)dsx(t) = X - \int_0^t v(s)\, ds is the remaining inventory. The objective is:

minv(){η0Tv(t)2dt+λσ220Tx(t)2dt},\min_{v(\cdot)} \left\{\eta\int_0^T v(t)^2\, dt + \frac{\lambda\sigma^2}{2}\int_0^T x(t)^2\, dt\right\},

subject to x(0)=Xx(0) = X, x(T)=0x(T) = 0, v(t)=x˙(t)0v(t) = -\dot{x}(t) \geq 0.

Closed-Form Solution via Calculus of Variations

The Euler-Lagrange equation for the functional 0T[ηv2+λσ22x2]dt\int_0^T [\eta v^2 + \frac{\lambda\sigma^2}{2}x^2]\, dt is:

2ηx¨(t)=λσ2x(t),2\eta \ddot{x}(t) = \lambda\sigma^2 x(t),

The full lesson requires Premium

The complete derivation, the C++ / Python implementation, the validation tables, the quiz, and the interview-angle notes are part of Premium. Start a Premium plan to unlock every module in this track.