Basic Prerequisites: 01 · From Zero and 02 · Weight Constraints.
1. Intuition & Practical Objective
A trade of size costs money in three distinct ways, and treating them as one number is the classic modeling error:
- The spread (linear, unavoidable). Cross the bid–ask and you pay roughly half the spread per share, plus commissions, exchange fees and taxes. This cost is linear in the quantity traded and independent of size - the same per-unit price whether you buy a hundred shares or a hundred thousand, up to the point where you have eaten the top of the book.
- Market impact (convex, size-dependent). Once your order consumes more than the displayed liquidity, you walk the book and then you signal your intent to others. The price moves against you, and the larger the order the worse the average price. This cost is convex in the quantity traded.
- The square-root law (empirical, concave). Measured across markets, realized impact scales roughly like - the cost therefore scales like , which is concave in . Doubling the order does not double the cost.
The practical objective is to know which term dominates at your size - and it is a knife-edge. At small size the linear term rules and the optimizer has a clean no-trade region. At large size the convex impact term rules and the optimizer trades less and slower. At institutional size the concave square-root law rules, and the problem is no longer convex, so you must either convexify it (a conservative approximation) or accept that the true optimum may require mixing orders.
The one-sentence essence. “Cost is a function of the trade, not a constant: linear at the touch, convex when you walk the book, concave when you measure the square-root law - and the shape of that function, not its level, is what determines whether you rebalance, how much, and how fast.”
2. Mathematical Ground Truth & Derivations
2.1 Where the linear coefficient comes from (microstructure)
The linear coefficient is not a free parameter - it is the spread, and microstructure gives it a structural decomposition.
- Roll (1984), Hasbrouck Ch 3. With an efficient price and a round-trip transactional cost , trade prices are with . Then and , so
- Glosten–Milgrom (1985), Hasbrouck Ch 5. With a symmetric value prior () and fraction of informed traders, the zero-profit spread is - the adverse-selection component.
- Generalized Roll (Hasbrouck Ch 8). Split the cost into a non-informational part and an adverse-selection/price-impact part : , , so
with only identified from two autocovariances. Kyle (1985), Hasbrouck Ch 7 supplies the equilibrium price impact as a function of value uncertainty and noise-trading variance , with the market depth. Amihud’s illiquidity ratio is the standard empirical proxy for (Hasbrouck Ch 9.9).
2.2 Quadratic impact (convex)
Model per-trade impact cost with a diagonal matrix reflecting each asset’s depth:
This is the time-integrated version of the Almgren–Chriss permanent + temporary impact model (Pillar 2), compressed into one rebalance. Convexity is the whole point: the optimization stays a QP and the answer is unique and computable.
2.3 The square-root law (concave → non-convex)
Empirically (since impact and cost ). Concavity has a sharp consequence: the marginal cost of the last unit is lower than the average, so a concave-cost optimizer wants to concentrate trades rather than spread them - the opposite of the convex case. Non-convexity also means the KKT conditions no longer certify a global optimum, and practical solvers use successive convex approximations (the -or-quadratic upper/lower surrogates of 06).
2.4 The cost-aware portfolio problem
The no-trade region (derived in 01) is the defining feature: for a single asset the optimal action is
Written for a portfolio, the -th asset moves only if the alpha gain in the direction of the trade exceeds the per-unit cost - which is why the cost-aware solution below leaves two of six weights exactly at their current values.
3. Computational Implementation - the three cost families
(A) the single-asset no-trade region in closed form; (B) the full portfolio with (i) no cost, (ii) linear only, (iii) linear + quadratic impact, plus a sweep of the impact severity ; (C) the cost curves of the three laws. numpy + scipy.
Four verified readings:
- (A) The no-trade region is real and wide. With p.a., and , the half-width is - twenty percentage points of weight. A held weight of against a target of produces zero trade; only a deviation beyond ( or ) triggers a trade, and even then only back to the band edge (/), not to the target.
- (B) Cost-awareness raises risk-adjusted return while cutting turnover. The blind portfolio delivers after its own trade costs. Adding only the linear spread lifts this to ; adding quadratic impact lifts it to - while turnover falls . Note the mechanics of the no-trade region: in the linear-only solution assets 5 and 6 sit exactly at their current ; the optimizer declines to touch them.
- (B, sweep) More impact severity ⇒ less trading, to a point. As rises from to , turnover falls monotonically , but net Sharpe peaks near () and then declines: over-penalizing impact leaves real alpha unharvested. This is the same dose-response curve as robustness (05).
- (C) The three laws cross. Below the linear cost dominates; the quadratic overtakes it soon after; and the concave square-root law is cheapest at small size but most expensive at large size ( at vs quadratic). Which cost model you choose changes the direction the optimizer wants to move.
4. Failure Modes & First-Principles Breakdowns
- Assuming static linear costs. Treating cost as a constant in basis points is right at the touch and wrong the moment size matters. In illiquid names or at open/close, the convex and concave regimes dominate and the linear-only solution over-trades by a wide margin.
- Ignoring impact additivity. Summing per-asset impact assumes your own names are independent. In reality trades share a factor: selling eight correlated names at once is one large market-wide trade, and the joint impact is larger than the sum of the parts (a cross-impact matrix with off-diagonal entries is the correct object; see 06).
- Using one for the whole universe. Frontline names and small-caps differ by an order of magnitude in spread. A scalar makes the optimizer over-trade the expensive names and under-trade the cheap ones - precisely backwards. Hasbrouck’s Ch 3 finding that the quoted spread ranged $0.01–$0.49 within one stock over one month is the empirical warning.
- Forgetting that the cost model is a forecast, not a measurement. and are estimated from past executions under past conditions. Underestimating them by a factor of two is the single most common cause of a strategy that backtests well and loses money live - quantified in 05.
5. References
- Lobo, Fazel & Boyd (2007), Portfolio Optimization with Linear and Fixed Transaction Costs, Annals of OR 152:341–365
- Almgren & Chriss (2000/01), Optimal Execution of Portfolio Transactions, Journal of Risk 3(2):5–39
- Hasbrouck (2007), Empirical Market Microstructure
- Grinold & Kahn (2000), Active Portfolio Management, 2nd ed.
- Kyle (1985), Continuous Auctions and Insider Trading, Econometrica 53(6):1315–1335
- Amihud (2002), Illiquidity and Stock Returns, Journal of Financial Markets 5(1):31–56
6. Connected Graph Bridges
- Back: 02 · Weight Constraints · 01 · From Zero
- Execution bridge: Optimal Execution (Almgren–Chriss) · POV
- Microstructure source: Spread Decomposition & the Roll Model · Adverse Selection & Glosten–Milgrom · Limit-Order-Book Mechanics & L3
- Continue: 04 · Turnover & the Multi-Period Trade-Off
- Foundations: Econometrics & Time Series · Calculus & Optimization
- Hub: Index Hub