Commission and Fee Modeling
Building realistic trading costs — commissions, exchange fees, and financing charges — into a backtest, so paper profits don't evaporate the moment the strategy trades for real.
Prerequisites: Look-Ahead Bias
A backtest that ignores costs is a fantasy: a strategy trading 500 names a day at a few basis points of edge can look brilliant gross and be a money-loser net, because commissions and fees are a fixed drag that scales with turnover regardless of whether the underlying signal is any good. Modeling them properly means charging every simulated trade something close to what a broker and exchange would actually charge, so backtest performance survives contact with reality.
The main components are a per-share or per-notional commission (what the broker charges), exchange and regulatory fees (maker/taker fees, SEC/FINRA fees on U.S. equity sales), and, for anything held short or leveraged, financing charges (borrow fees on shorts, margin interest on leverage). A common shortcut is to model all of this as a flat cost per trade in basis points of notional — say 2–5 bps round-trip for liquid large-cap equities — deducted directly from the simulated P&L on every fill.
The trap is under-charging on strategies with high turnover: a strategy that trades $10m of notional a day at a real 3 bps round-trip cost pays roughly $3,000 daily in costs alone, which a slow, low-turnover strategy never faces. Backtests that use a single blanket cost assumption across very different turnover profiles routinely make high-frequency ideas look far more attractive than they are. A more careful model also varies the assumed cost by liquidity tier, since a thinly traded small-cap name genuinely costs more in fees and spread to trade than a heavily traded large-cap one, even at identical notional size.
Cost drag scales with turnover, not with edge — always test whether a strategy's net-of-cost Sharpe ratio still looks attractive once trading frequency, not just gross signal quality, is priced in.
Related concepts
Practice in interviews
Further reading
- Kissell, The Science of Algorithmic Trading and Portfolio Management, ch. 3