Trading Dev AcademyFree quant education

Free lesson · Trading algorithms

Optimal execution: impact versus waiting risk

Open interactive lessonPractice calculationsExplore labs

Start with the idea

An optimal-execution model trades off the cost of trading quickly against the risk of waiting. The best schedule depends on the assumed impact, volatility, urgency and market response.

Symbols, units & horizon
  • Q: total parent quantity
  • q: first-bucket quantity
  • Q−q: second-bucket quantity held during the wait
  • η: positive quadratic impact coefficient
  • λ: nonnegative risk-aversion scaling
  • σ²: price variance rate
  • Δt: waiting time
  • J: cost-plus-risk objective in consistent units
  • q*: optimum of this two-bucket simplification

When and why to use this

Use an explicit execution objective when urgency and market impact must be balanced, keeping a simple schedule as the benchmark.

Almgren–Chriss-style models formalise temporary/permanent impact and price risk; modern extensions can include predictive signals, transient cross-impact and constraints. A model-derived schedule is useful because its trade-offs are explicit, but its quality depends on calibrated costs and dynamics.

Consider two execution buckets. Trading more in the first bucket increases immediate impact but leaves less inventory exposed to price movement before the second. With no risk penalty and identical liquidity, splitting evenly minimises a quadratic temporary-impact cost. More waiting risk shifts quantity earlier.

Compare the resulting schedule with TWAP, VWAP and a participation rule under the same parent orders. Cost models fitted on small historical orders may not extrapolate to larger size. Jointly executing related legs can involve cross-impact, which the simple two-bucket example omits.

J(q)=η[q2+(Q−q)2]+λσ2(Q−q)2Δt,q∗=Qη+λσ2Δt2η+λσ2Δt
Model assumptions, derivation and arithmetic

Optimal execution: impact versus waiting risk

  1. Differentiate impact: 2ηq−2η(Q−q). Differentiate the waiting penalty: −2λσ²Δt(Q−q).
  2. Set their sum to zero and collect q(2η+λσ²Δt)=Q(η+λσ²Δt).
  3. Divide by the positive coefficient. With zero waiting penalty, q=Q/2; as the waiting penalty grows, the first bucket approaches Q.
Work it by hand

Q=100, η=1 and λσ²Δt=2 give q*=100×3/4=75 units now and 25 later. With zero risk penalty, the same impact model splits 50/50.

Apply it in a strategy

  • Estimate impact and price-risk inputs from comparable parent orders, with uncertainty and capacity limits.
  • Solve the schedule subject to participation and completion constraints.
  • Evaluate implementation shortfall and tail cost on future parent orders, including incorrect-model stresses.

Research deliverable

Present a cost-versus-urgency curve and compare realised parent-order outcomes with TWAP/VWAP/POV baselines.

Research checkpoint · reviewed 11 September 2026

These sources inform the questions to test. A result is conditional on its data, simulator and evaluation design. The examples in this module are teaching calculations, not reproductions of the reported experiments.

Documented execution use. Current broker documentation was checked for the VWAP execution objective; official order references also list TWAP and percentage-of-volume algorithms. This supports their inclusion as practical execution methods, not a claim about market share. Broker implementations and supported parameters differ from the simplified teaching schedules.

Further reading: Interactive Brokers · algorithmic order documentation ↗

Established filtering and forecasting implementations. Official documentation describes state-space and Kalman-filter support for time-series models. These are implementation references, not financial profitability studies. The formulas here are self-contained examples and do not depend on a particular installed statsmodels version.

Further reading: statsmodels · state-space methods ↗

Foundational algorithm reference. The original XGBoost paper was checked as the primary source for the tree-boosting system. Its general machine-learning benchmarks do not establish a trading edge. For recent finance-specific evidence and its limits, see the ML research checkpoint; for September 2026 cross-impact research, see statistical arbitrage.

Further reading: Chen & Guestrin · XGBoost: A Scalable Tree Boosting System ↗

Research sources, review dates and limitations

Extend the research question

Choose an algorithm only after defining available inputs, required latency and a benchmark. Record the entire information set used in initialization and tuning.

Continue with the connected research module →

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def two_bucket_execution(quantity,impact,waiting_penalty):
    if quantity<0 or impact<=0 or waiting_penalty<0: raise ValueError("Valid execution inputs required")
    first=quantity*(impact+waiting_penalty)/(2*impact+waiting_penalty)
    return first,quantity-first

print(two_bucket_execution(100,1,2))

Continue learning

Trading Algorithms: A Practical Selection Guide — all lessons
  1. Moving averages, EWMA and momentum/reversion rules
  2. Kalman filtering: combine a prediction with a noisy observation
  3. ARIMA for conditional means and GARCH for conditional variance
  4. Linear models, random forests and gradient boosting
  5. PCA, clustering, risk parity and quadratic programming
  6. TWAP, VWAP and percentage-of-volume execution
  7. Optimal execution: impact versus waiting risk

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations