---
title: Optimal Execution in Trading
url: https://www.emergentmind.com/topics/optimal-execution-problem
type: topic
---

# Optimal Execution in Trading

The optimal execution problem is the study of how a trader should dynamically schedule purchases or sales of a large block of shares (or other assets) over a specified time horizon, under market microstructure constraints and uncertainty, in order to minimize execution costs while meeting prescribed constraints on order completion. This framework models both the transient and permanent effects of trades on price, incorporates time-varying and stochastic liquidity, and accounts for resilience and regime changes within limit-order books.

## 1. Stochastic Control Model and Market Microstructure

The canonical setup involves a filtered probability space supporting a Brownian motion, a Poisson random measure, and a finite-state regime-switching Markov chain that encodes abrupt liquidity shifts. The unaffected price process \( A_t \) is a continuous martingale, while the impacted ask price is given by
\[
P_t = A_t + D_t, \qquad D_t = \psi_{I_t}(Y_t),
\]
where \( Y_t \) is a “volume-effect process,” and \( \psi_i \) is the inverse cumulative supply function for regime \( i \). The limit-order book (LOB) shape in each regime is specified by a nonnegative measure \( \mu_i \), with cumulative depth function \( F_i(x) = \mu_i([0,x)) \), and supply-inverse \( \psi_i \) defined via \( F_i(\psi_i(y)) = y \). The impact cost for consuming volume \( y \) is given by
\[
\Phi_i(y) = \int_0^y \psi_i(u)\, du.
\]
The “volume-effect” process evolves stochastically:
\[
dY_t = -h(Y_{t^-})\,dt + \sigma(Y_{t^-})\,dW_t + \int_{\mathbb{R}} q(Y_{t^-}, z)\,(M(dt, dz) - \lambda_t\nu(dz)dt),
\]
where \( h \) models resilience, \( \sigma \) continuous liquidity fluctuations, and \( q \) jump responses. Regime-switching between LOB shapes is governed by a Markov chain \( I_t \) with generator \( Q(t) \).

The trader's control \( X_t \) is a nondecreasing, adapted, càdlàg process (allowing both continuous “slice” trading and block trades), constrained by initial and terminal inventory (\( X_{t^-} = x \), \( X_T = \bar X \), \( 0 \le X_u \le \bar X \)).

## 2. Execution Cost Functionals and Admissible Control

Trading incurs both continuous and jump (block) costs. For continuous trading, the incremental cost is
\[
(A_u + \psi_{I_{u^-}}(\check Y_{u^-}))\, dX^c_u,
\]
while the cost for a block trade \( \Delta X_u \) at \( u \) is
\[
\int_0^{\Delta X_u} [A_u + \psi_{I_u}(\check Y_{u^-} + v)]\, dv = A_u \Delta X_u + \Phi_{I_u}(\check Y_{u^-} + \Delta X_u) - \Phi_{I_u}(\check Y_{u^-}).
\]
The objective is to minimize the expected “excess cost” (over a martingale reference price) defined as
\[
J_i(t, x, y; X) = \mathbb{E} \biggl[ \int_t^T \psi_{I_u}(\check Y_{u^-})\, dX^c_u + \sum_{t \le u \le T} \bigl\{ \Phi_{I_u}(Y_u) - \Phi_{I_{u^-}}(\check Y_{u^-}) \bigr\} \biggr],
\]
where \( X \) ranges over the admissible set given initial shares purchased and \( Y^{t, y, X} \) solves the associated controlled SDE flow. The value function is:
\[
v_i(t, x, y) = \inf_{X \in \mathcal{A}_t(x)} J_i(t, x, y; X), \quad I_{t^-} = i.
\]
Boundary and terminal conditions are
\[
v_i(T, x, y) = \Phi_i(y+\bar X-x) - \Phi_i(y), \qquad v_i(t, \bar X, y) = 0.
\]

## 3. Variational Inequality and Viscosity Solution Characterization

The dynamic programming principle yields a coupled system of Hamilton-Jacobi-Bellman quasi-variational inequalities (HJB-QVI):
\[
\max \bigg\{
  -v_{i, t} - \mathcal{L} v_i - \sum_{j \neq i} Q_{ij}(v_j - v_i),\;
  -\bigl( v_{i, x} + v_{i, y} + \psi_i(y) \bigr)
\bigg\} = 0,
\]
where \( \mathcal{L} \) is the integro-diffusion operator in \( (t,y) \):
\[
\mathcal{L} \varphi = -h(y)\varphi_y + \frac{1}{2}\sigma^2(y)\varphi_{yy} + \lambda_t\! \int [\varphi(t, x, y + q(y, z)) - \varphi(t, x, y)]\, \nu(dz).
\]
The two branches correspond to the “continuation region” (no trade, process evolves stochastically) and “execution region” (block trade to reduce price impact). In the continuation region:
\[
-v_{i, t} - \mathcal{L} v_i - \sum_{j \neq i} Q_{ij}(v_j - v_i) = 0,
\]
and in the execution region:
\[
v_{i, x} + v_{i, y} + \psi_i(y) = 0.
\]
There exists a unique continuous viscosity solution under standard growth and continuity assumptions, with uniqueness established via comparison principles, including Ishii’s lemma and coupling across regimes.

## 4. Free Boundary and Structural Properties

The interface between continuation and execution regions is a free boundary \( y^*_i(t, x) \), satisfying:
\[
\mathcal{E}_i = \{ y \ge y^*_i(t, x) \}, \quad \mathcal{C}_i = \{ y < y^*_i(t, x) \}.
\]
Properties of the free boundary include monotonicity in impact and inventory, a connected threshold structure, and partial smooth-fit: the derivatives \( v_x, v_y \) match continuously along \( \partial \mathcal{E}_i \). For certain LOB shapes (e.g., block-shaped, linear resilience), closed-form expressions for \( y^*(t, x) \) are available; in more general cases, the boundary is found numerically.

## 5. Numerical Procedures and Simulation

For a range of LOB shapes, e.g., power-law (square-root) LOBs or constant-density blocks, the HJB-QVI is solved with an implicit-explicit finite difference method, and the integral term handled by the trapezoidal rule. Sample parameters (\( c, d, e, \eta, \kappa, \gamma_i, \lambda, \bar X, Y_{\max}, T \)) are used to generate numerical experiments.

Within this framework, the optimal policy is:
- No trade in \( \mathcal{C}_i \).
- An instantaneous jump (block trade) to the free boundary when at \( (t, x, y) \in \mathcal{E}_i \).
Regime-switching effects: the trader front-runs into high-impact regimes by expanding \( \mathcal{E}_i \), while the converse occurs in benign regimes. Comparative statics show that increased jump intensity or price-impact exponent enlarge the execution domain; higher resilience or volatility shrink it, favoring delayed trading.

## 6. Connections to Broader Literature and Methodological Implications

The described stochastic singular control setup unifies transience, resilience, and regime-shifting phenomena. It generalizes classical frameworks where liquidity is deterministic or price recovery is absent. The free-boundary approach is directly inherited from related studies on optimal trading under limit order book (LOB) models with resilience and stochastic impact. The structure of HJB-QVI and free-boundary problems appears in related works on price recovery after large trades, tolerance-surface policies, and impulse/continuous control hybrids. The model also connects to formulations using quadratic backward stochastic differential equations (BSDEs) and actor-critic deep learning–based surrogates for parametric optimal execution policies.

## 7. Practical and Theoretical Implications

The article provides a fully characterizable model for optimal block execution in environments with liquidity uncertainty, resilience, and exogenous shocks. It delivers both a rigorous PDE/viscosity solution foundation and practical numerics for the free-boundary problem, showing how price impact, market recovery, and stochastic regime switches fundamentally shape execution strategies. This structure gives quantitative insights into how real-world features—market microstructure noise, abrupt liquidity regime changes, or LOB nonlinearities—should inform execution scheduling and risk management in large-scale trades [2506.11813].

Source: https://www.emergentmind.com/topics/optimal-execution-problem