5D Library › High-Frequency Limit Order Book Microstructure, Hawkes Self-Exciting Point Processes and Adverse-Selection Flow Toxicity · 中文

Chapter 6 How to Split a Large Order: Almgren–Chriss Optimal Execution

Implementation shortfall

The previous chapters stood on the side of the liquidity provider; this chapter moves to the side that needs liquidity. An institution decides to sell a million shares, and between the price at the moment of decision (the “arrival price”) and the last share executed it usually receives less than the “paper” value. Perold called this difference the implementation shortfall and split it into explicit costs, impact costs and the opportunity cost of delay (Perold 1988). Selling fast means large impact; selling slowly leaves the price to wander in the meantime and makes the outcome uncertain. Optimal execution is about this trade-off.

Bertsimas and Lo treated the risk-neutral case by dynamic programming in 1998: with linear permanent impact and no informative drift in prices, the strategy with the lowest expected cost spreads the order evenly over time, the TWAP (time-weighted average price) strategy (Bertsimas and Lo 1998). Almgren and Chriss brought risk into the objective and derived an efficient frontier in the mean–variance sense (Almgren and Chriss 2001).

The Almgren–Chriss model

Divide the execution period [0,T][0, T] into NN intervals of length τ=T/N\tau = T/N; let xkx_k be the shares still held at time kk (x0=Xx_0 = X, xN=0x_N = 0) and nk=xk−1−xkn_k = x_{k-1} – x_k the shares sold in interval kk. The price evolves as

Sk=Sk−1+στ1/2ξk−τg(nk/τ),S_k = S_{k-1} + \sigma\tau^{1/2}\xi_k – \tau\,g(n_k/\tau),

where g(v)=γvg(v) = \gamma v is the permanent impact; the execution price in interval kk is Sk−1−h(nk/τ)S_{k-1} – h(n_k/\tau), where h(v)=εsgn(v)+ηvh(v) = \varepsilon\,\mathrm{sgn}(v) + \eta v is the temporary impact (ε\varepsilon is roughly half the spread plus fees). The expectation and variance of the shortfall XS0−∑nkS̃kX S_0 – \sum n_k \tilde S_k are

E=12γX2+εX+η̃τ∑knk2,V=σ2τ∑kxk2,η̃=η(1−γτ2η).E = \tfrac12\gamma X^2 + \varepsilon X + \frac{\tilde\eta}{\tau}\sum_k n_k^2, \qquad V = \sigma^2\tau\sum_k x_k^2, \qquad \tilde\eta = \eta\left(1 – \frac{\gamma\tau}{2\eta}\right).

Minimising E+λVE + \lambda V for a given risk aversion λ\lambda gives

xk=sinh⁡(κ(T−tk))sinh⁡(κT)X,2τ2(cosh⁡(κτ)−1)=λσ2η̃.x_k = \frac{\sinh\big(\kappa(T – t_k)\big)}{\sinh(\kappa T)}\,X, \qquad \frac{2}{\tau^2}\big(\cosh(\kappa\tau) – 1\big) = \frac{\lambda\sigma^2}{\tilde\eta}.

The larger λ\lambda, the larger κ\kappa and the more “front-loaded” the trajectory: more is sold early, buying lower variance with higher expected cost. As λ→0\lambda \to 0 the trajectory becomes a straight line, TWAP; 1/κ1/\kappa can be read as the time scale over which most of the position is sold. Plotting the result for all λ≥0\lambda \ge 0 traces the efficient frontier in the plane of expected cost and standard deviation. The hyperbolic-sine trajectory, the role of λ\lambda and the efficient frontier in the author’s framework check out, but their conditions should be stated: linear permanent and temporary impact, arithmetic Brownian motion, no predictable drift in prices, and a mean–variance criterion.

Evidence

Three points are worth adding about these assumptions. First, Huberman and Stanzl proved that, within their framework, permanent impact must be linear if profitable price manipulation by round trips (quasi-arbitrage) is to be ruled out (Huberman and Stanzl 2004); this gives a theoretical reason for linear permanent impact. Second, Obizhaeva and Wang built the finite depth and recovery (resilience) of the order book into the model; the optimal strategy then has a discrete trade at the start and at the end and trades at a continuous rate in between, unlike the smooth Almgren–Chriss trajectory (Obizhaeva and Wang 2013). Third, the empirical impact of metaorders is roughly proportional to the square root of volume rather than linear (discussed in Book 39), so linear temporary impact is a convenient approximation.

The program below uses illustrative parameters: a $50 stock, a million shares to sell over 5 days in 50 slices, daily volatility $0.95, γ=2.5×10−7\gamma = 2.5\times10^{-7}, η=2.5×10−6\eta = 2.5\times10^{-6} and ε=0.0625\varepsilon = 0.0625. It computes the expected shortfall, its standard deviation and the time scale 1/κ1/\kappa for several values of λ\lambda, checks the formulas by Monte Carlo, and finally compares TWAP with a VWAP schedule following a U-shaped intraday volume profile.

Calculation

# Almgren-Chriss (2001) optimal liquidation of X shares in N periods of length tau with
# linear permanent impact g(v) = gam v and temporary impact h(v) = eps sgn(v) + eta v.
# Optimal holdings x_k = X sinh(kap (T - t_k)) / sinh(kap T), where
#   (2 / tau^2) (cosh(kap tau) - 1) = lam sig^2 / eta_t,
#   eta_t = eta (1 - gam tau / (2 eta)).
# Expected shortfall E = gam X^2 / 2 + eps X + (eta_t / tau) sum n_k^2,
# variance V = sig^2 tau sum x_k^2. Parameters are ILLUSTRATIVE (a $50 stock, 1,000,000
# shares over 5 days in 50 slices); lam is the risk aversion (per $).
import math, random, statistics

X, S0, SIG, T, N = 1_000_000, 50.0, 0.95, 5.0, 50
GAM, ETA, EPS = 2.5e-7, 2.5e-6, 0.0625
TAU = T / N; ETAT = ETA * (1 - GAM * TAU / (2 * ETA))

def traj(lam):
    if lam == 0:
        return [X * (1 - k / N) for k in range(N + 1)]
    kap = math.acosh(1 + lam * SIG ** 2 / ETAT * TAU ** 2 / 2) / TAU
    return [X * math.sinh(kap * (T - k * TAU)) / math.sinh(kap * T) for k in range(N + 1)]

def cost(x, eta_k=None):
    n = [a - b for a, b in zip(x, x[1:])]
    eta_k = eta_k or [ETAT] * N
    E = GAM * X ** 2 / 2 + EPS * X + sum(e / TAU * v * v for e, v in zip(eta_k, n))
    V = SIG ** 2 * TAU * sum(v * v for v in x[1:])
    return E, V

def simulate(x, rng, paths=20_000):
    n = [a - b for a, b in zip(x, x[1:])]; out = []
    for _ in range(paths):
        S, cash = S0, 0.0
        for v in n:                                        # slice k sells at S_{k-1} - h
            cash += v * (S - EPS - ETA * v / TAU)
            S += SIG * math.sqrt(TAU) * rng.gauss(0, 1) - GAM * v
        out.append(X * S0 - cash)                          # implementation shortfall
    return out

if __name__ == "__main__":
    print("strategy                     E[shortfall] $   sd $     1/kappa (days)")
    for name, lam in (("TWAP (lam = 0)", 0), ("lam = 1e-7", 1e-7), ("lam = 1e-6", 1e-6),
                      ("lam = 1e-5", 1e-5), ("lam = 1e-4", 1e-4)):
        x = traj(lam); E, V = cost(x)
        kap = (math.acosh(1 + lam * SIG ** 2 / ETAT * TAU ** 2 / 2) / TAU) if lam else 0
        hl = f"{1 / kap:8.2f}" if lam else "       -"
        print(f"  {name:24s}   {E:12,.0f}   {math.sqrt(V):9,.0f}   {hl}")
    E1 = GAM * X ** 2 / 2 + EPS * X + ETAT / TAU * X ** 2
    print(f"  {'everything in slice 1':24s}   {E1:12,.0f}   {0:9,.0f}")
    rng = random.Random(2001); x = traj(1e-6); E, V = cost(x); sim = simulate(x, rng)
    print(f"Monte Carlo, lam = 1e-6, 20,000 paths: mean {statistics.fmean(sim):,.0f}"
          f" ({E:,.0f}), sd {statistics.stdev(sim):,.0f} ({math.sqrt(V):,.0f})")
    u = [1.6, 1.2, 1.0, 0.85, 0.8, 0.8, 0.85, 1.0, 1.3, 1.6]       # intraday U-shape
    vol = [u[k % 10] for k in range(N)]; vbar = statistics.fmean(vol)
    xv = [X]
    for v in vol:
        xv.append(xv[-1] - X * v / sum(vol))
    xv[-1] = 0.0
    eta_v = [ETAT * vbar / v for v in vol]                 # thinner book in quiet periods
    for lab, ek in (("constant eta", None), ("eta inversely prop. to volume", eta_v)):
        Et, Vt = cost(traj(0), ek); Ev, Vv = cost(xv, ek)
        print(f"{lab}: TWAP E {Et:,.0f} sd {math.sqrt(Vt):,.0f};"
              f" VWAP E {Ev:,.0f} sd {math.sqrt(Vv):,.0f}")
# strategy                     E[shortfall] $   sd $     1/kappa (days)
#   TWAP (lam = 0)                  685,000   1,208,032          -
#   lam = 1e-7                      692,710   1,139,533       5.25
#   lam = 1e-6                      961,940     828,686       1.66
#   lam = 1e-5                    2,545,884     441,579       0.53
#   lam = 1e-4                    7,360,846     199,051       0.17
#   everything in slice 1        25,062,500           0
# Monte Carlo, lam = 1e-6, 20,000 paths: mean 956,607 (961,940), sd 830,322 (828,686)
# constant eta: TWAP E 685,000 sd 1,208,032; VWAP E 720,976 sd 1,207,900
# eta inversely prop. to volume: TWAP E 718,634 sd 1,208,032; VWAP E 685,000 sd 1,207,900

TWAP (λ=0\lambda = 0) has an expected shortfall of $685,000 with a standard deviation of $1,208,032; with λ=10−6\lambda = 10^{-6} the expected shortfall rises to $961,940, the standard deviation falls to $828,686 and 1/κ=1.661/\kappa = 1.66 days; with λ=10−4\lambda = 10^{-4} the expected shortfall is $7,360,846 and the standard deviation only $199,051. Selling everything in the first slice costs an expected $25,062,500 with zero standard deviation. Monte Carlo (20,000 paths) gives a mean of $956,607 and a standard deviation of $830,322, within simulation error of the formulas’ $961,940 and $828,686 (the standard error of the mean is about $5,900). Figure 5 shows the efficient frontier on the left and holdings trajectories for several values of λ\lambda on the right.

Left: the Almgren–Chriss efficient frontier (expected shortfall against its standard deviation); circle: TWAP; square and triangle: λ = 10^-6 and 10^-5. Right: holdings trajectories for different risk aversions (illustrative parameters).

TWAP, VWAP and aggressive execution

The author’s framework asks for the optimal trajectory to be compared with TWAP, VWAP and aggressive execution. TWAP is the λ=0\lambda = 0 end of the frontier: lowest expected cost, highest risk. Aggressive execution is the other end: almost no price risk but very large temporary impact. A VWAP (volume-weighted average price) strategy allocates the sale according to the expected intraday volume profile and is often used as a benchmark of execution quality; Konishi derived the allocation that targets VWAP, minimising the variance of the difference between the execution price and the market’s VWAP (Konishi 2002).

The last two lines of the program show where VWAP sits in the Almgren–Chriss framework. If the temporary-impact coefficient η\eta is constant through the day, VWAP merely moves sales from quiet to busy periods; its expected cost is $720,976, 5.3 % above TWAP, with almost the same standard deviation, so it is not on the efficient frontier. If temporary impact is inversely proportional to the volume of each period (the busier the market, the smaller the impact), the conclusion is reversed: VWAP’s expected cost is $685,000, exactly the risk-neutral optimum, while TWAP’s rises to $718,634, 4.9 % higher. So whether “VWAP is optimal” depends on how impact varies with volume and cannot be asserted in general.

Note

Iceberg orders. The author’s framework puts “iceberg-order splitting” in this chapter’s title. The Almgren–Chriss model answers “how much to sell in each interval” and assumes each slice executes according to the temporary-impact function; how each slice is placed (market or limit orders, how much is displayed) is another layer. An iceberg order displays only part of its quantity and trades queue position for less information exposure, as discussed in the note to Chapter 5, which cites Esser and Mönch’s model of the optimal displayed size (Esser and Mönch 2007). In practice the two are usually handled in layers: an upper layer sets each interval’s quantity from the execution schedule, and a lower layer decides how each slice is placed.

Hypothesis · not established · Systematic bias of linear impact

The author’s hypothesis (not established): in real metaorder data, Almgren–Chriss pre-trade cost estimates calibrated with linear temporary impact systematically underestimate the shortfall of large orders (a high share of daily volume) and overestimate that of small orders, consistent with concave impact (such as a square-root law). What would show it wrong: with data, size groups and calibration method fixed in advance, a confidence interval for the slope of “actual shortfall minus pre-trade estimate” on order size that includes zero.

Chapter summary

Under linear impact and a mean–variance criterion, the Almgren–Chriss model gives a hyperbolic-sine optimal trajectory; the risk aversion λ\lambda slides between expected cost and variance, tracing the efficient frontier, with TWAP and aggressive execution at its two ends. In the program, Monte Carlo agrees with the formulas. VWAP is the risk-neutral optimum only when temporary impact is inversely proportional to volume; with constant impact it costs 5.3 % more than TWAP. Iceberg orders are a question of how orders are displayed, handled in a separate layer from the splitting schedule. Linear impact is a convenient approximation; the empirical impact of metaorders is close to a square-root law (Book 39).

References

Almgren, Robert, and Neil Chriss. 2001. “Optimal Execution of Portfolio Transactions.” Journal of Risk 3 (2): 5–39. https://doi.org/10.21314/JOR.2001.041.
Bertsimas, Dimitris, and Andrew W. Lo. 1998. “Optimal Control of Execution Costs.” Journal of Financial Markets 1 (1): 1–50.
Esser, Angelika, and Burkart Mönch. 2007. “The Navigation of an Iceberg: The Optimal Use of Hidden Orders.” Finance Research Letters 4 (2): 68–81.
Huberman, Gur, and Werner Stanzl. 2004. “Price Manipulation and Quasi-Arbitrage.” Econometrica 72 (4): 1247–75.
Konishi, Hizuru. 2002. “Optimal Slice of a VWAP Trade.” Journal of Financial Markets 5 (2): 197–221.
Obizhaeva, Anna A., and Jiang Wang. 2013. “Optimal Trading Strategy and Supply/Demand Dynamics.” Journal of Financial Markets 16 (1): 1–32.
Perold, André F. 1988. “The Implementation Shortfall: Paper Versus Reality.” Journal of Portfolio Management 14 (3): 4–9.

Fan, Y. (2026). High-Frequency Limit Order Book Microstructure, Hawkes Self-Exciting Point Processes and Adverse-Selection Flow Toxicity: From the Avellaneda–Stoikov Market-Making Equations to VPIN, Read Beside Classical Chinese Thought on Market Equilibrium [高频限价订单簿微观结构、霍克斯自激点过程与逆向选择毒流] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23828065 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).