The two costs, stated as functions of speed
The previous lesson ended with a conflict. Making it precise turns it into a solvable problem.
Let the order be worked over a horizon T. Trading faster means a larger quantity per unit time, and impact grows with the rate at which liquidity is consumed. So expected cost falls as T rises.
Meanwhile the unexecuted portion of the order remains exposed to whatever the price does. Over a longer horizon the price has more time to wander, and the variance of the final outcome grows with T. So risk rises as T rises.
One is an expectation and the other a variance, which is what makes the problem tractable: it has the same shape as portfolio selection. Choose the schedule that minimises expected cost plus a penalty times variance, and the penalty is where preference enters.
Robert Almgren and Neil Chriss set this out in "Optimal Execution of Portfolio Transactions", Journal of Risk, volume 3, 2000, pages 5 to 39, framing liquidation over a fixed horizon as a mean-variance trade-off between impact costs from trading too quickly and timing risk from trading too slowly.

