Implementation shortfall
Implementation shortfall is the gap between the price when you decided to trade and the price you actually got. Trading fast pays more impact; trading slowly lets the price drift away. The best speed balances the two.
01The formula
- expected cost against the decision price, for an order worked over time T
- the adverse drift: how fast the price moves away from you while you wait, per day
- the delay between deciding and starting to trade
- how long you take to execute, as a fraction of the day
- impact cost per unit of participation rate
- order size as a share of daily volume, so Q/(VT) is your participation rate
- the execution time with the lowest total expected cost
02See it move
03Where it is used
- Execution traderChooses how aggressively to work an order by comparing impact against the expected drift.
- Portfolio managerMeasures the full cost of turning ideas into positions, including orders that were delayed or never filled.
- Quant researcherEstimates how fast a signal decays, which sets α and so how urgently its trades should be executed.
04Why traders use it
A strategy's paper returns assume you trade at the decision price. Implementation shortfall is the honest bill, and choosing the execution speed well can save more than any spread negotiation.
05Worked example
Working 5% of daily volume over 2.00 hours, with drift 40 bp per day, costs about 23.9 bp: 16.3 bp of impact and 7.7 bp from waiting. The cheapest schedule takes 3.25 hours.
06How it is built
- Fix the decision price: the mid when you decided to trade.
- Delay cost: while you wait before starting, the price drifts by .
- Opportunity cost: trading evenly over , the average unfilled share waits , paying .
- Impact cost: trading at participation rate costs , which falls as grows.
- Set the derivative of opportunity plus impact to zero: , so .
07The common mistake
Measuring only the filled part. If a slow order never completes, the shares you failed to buy still missed the move; leaving them out makes passive execution look far cheaper than it was.
08In Python and LaTeX
import numpy as np alpha, c, q, T_h, delay_min = 40e-4, 10e-4 / 0.1, 0.05, 2.0, 15 T = T_h / 6.5 IS = alpha * delay_min / 60 / 6.5 + alpha * T / 2 + c * q / T print(round(IS * 1e4, 1), 'bp; best T:', round(6.5 * np.sqrt(2 * c * q / alpha), 2), 'hours')
\text{IS}(T) = \underbrace{\alpha\,t_d}_{\text{delay}} + \underbrace{\tfrac12\,\alpha\,T}_{\text{opportunity}} + \underbrace{c\,\frac{Q}{V\,T}}_{\text{impact}}, \qquad T^* = \sqrt{\frac{2\,c\,Q/V}{\alpha}}09Where it fits
Rather not code the maths yourself? Describe your trading idea and let AI build the bot.
Build a bot with AgenKitThe worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.