Modelling Costs & Slippage
The gap between the backtest fill and the real one. Ignore it and your edge evaporates live.
A backtestTesting a trading strategy on historical data. fills your orders at perfect prices for free. Reality charges you — brokerageAn intermediary licensed to execute your trades., taxes (STT, stamp duty, GST), exchangeA regulated marketplace where shares are bought and sold. fees, and *slippageThe gap between expected and actual trade price.* (the gapA jump between one bar’s close and the next bar’s open. between the price you wanted and the price you actually got). Modelling these honestly is what separates a backtestTesting a trading strategy on historical data. that survives live from one that dies on contact.
- The components — brokerageAn intermediary licensed to execute your trades., STT/stamp/GST, exchangeA regulated marketplace where shares are bought and sold. fees, and slippageThe gap between expected and actual trade price. (the bid-ask and market-impact gapA jump between one bar’s close and the next bar’s open.).
- Turnover is the killer — costs scale with the number of trades; high-frequency strategies are most exposed.
- SlippageThe gap between expected and actual trade price. is conditional — it grows with position size and in volatile/illiquidHow easily an asset can be bought or sold without moving its price. markets, right when you need to trade.
- The rule — model realistic costs on every fill; a strategy only profitable with zero costs is not a strategy.
How much slippage should I assume in a backtest?
Be conservative and realistic for your market and size — a common approach models a few basis points plus extra for volatility and volume (this platform uses a realistic slippage model by default). When unsure, over-estimate: a strategy that survives pessimistic cost assumptions is far more trustworthy than one that only works assuming frictionless fills.