The Role of Slippage & Commissions in Realistic Backtesting
The Mirage of Perfect Backtests
Backtesting is the bedrock of systematic trading. It offers the seductive promise of peering into the future by analyzing the past. Yet, a backtest that ignores the friction of real markets is not a simulation; it is a hallucination. The two primary culprits transforming a promising strategy into a portfolio destroyer are slippage and commissions. Without modeling these costs with precision, your carefully calculated Sharpe ratio and equity curve are nothing more than a fantasy.
Deconstructing Slippage: More Than Just a Spread
Slippage is the difference between the expected price of a trade and the actual price at which it is executed. It is not a static number. For a robust backtest, you must model its three distinct components.
1. The Bid-Ask Spread
This is the most visible form of slippage. When a backtest assumes you buy at the last traded price, it ignores the reality that you buy at the ask (higher) and sell at the bid (lower). For liquid blue-chip stocks, this might be one cent. For micro-cap equities or forex pairs during non-liquid hours, it can be dozens of pips.
How to model it: Do not use a flat spread. Pull historical spread data from your data provider (e.g., Tick Data, Dukascopy, or Polygon). Apply the average spread for the specific time and liquidity conditions of your entry signal. A strategy trading at the market open will face a wider spread than one trading at 2:00 PM EST.
2. Market Impact (The Silent Equity Killer)
This is the most underestimated variable for retail and institutional traders alike. Market impact occurs when your order size is large enough to move the price against you. Even a small 1% position in a low-volume stock can push the price up by several ticks on entry.
The math: If your backtest shows a 10,000-share entry at $50.00, but your execution algorithm (or market order) consumes the first 500 shares at $50.00, the next 1,000 at $50.01, and the rest at $50.03, your average price is significantly higher than $50.00.
How to model it: Use a simple volume-weighted average price (VWAP) slippage model. Calculate your trade size as a percentage of the average daily volume (ADV). A rule of thumb: for every 1% of ADV you trade, add 0.5 to 1 basis point of slippage for high-liquidity stocks, and upwards of 10-20 basis points for illiquid instruments. More advanced models use the Almgren-Chriss framework to simulate the cost of aggressive vs. passive execution.
3. Latency & Queue Position
Your backtest assumes instant execution. In reality, your order enters a queue. If you send a market order, you pay the spread. If you send a limit order, you risk non-execution or adverse selection (getting filled just as the price is about to move against you). Slippage from latency—even 50 milliseconds—can turn a winning edge into a losing one, especially in high-frequency or short-mean-reversion strategies.
How to model it: Add a random execution delay of 1 to 5 seconds to your backtest. For strategies with holding periods under 15 minutes, this delay can completely invalidate the results.
Commissions: The Cumulative Drag
Commissions are straightforward but dangerously easy to underestimate. A flat $5 per trade sounds negligible on a $100,000 account. However, for a strategy with 1,000 trades per year, that’s $5,000 in annual costs. On a $50,000 account, that’s a 10% drag on returns before you even consider profitability.
Per-Share vs. Per-Trade
Modern brokers (IBKR, Tradestation, Robinhood) offer commission structures that vary wildly.
- Per-Share: 0.005 per share. A 500-share entry costs $2.50.
- Per-Trade: $5.00 flat. The same trade costs $5.00.
Modeling tip: Do not use a flat dollar amount. Model your specific broker’s sliding scale. Include exchange fees (e.g., maker-taker rebates on IEX or NYSE) if you are running a high-volume strategy. A strategy designed for rebates (taking liquidity) vs. paying for liquidity (taker) changes the commission by a factor of 3-5x.
Hidden Regulatory Fees
Beyond commissions, exchange and regulatory fees eat into profits. In the US, the SEC Section 31 fee ($20.70 per million dollars of securities sold) and FINRA Trading Activity Fee (0.000119 per share) accumulate. A backtest that ignores these is missing 0.5-2 cents per round-turn trade.
The Naked P&L: Why 95% of Strategies Fail This Test
A common mistake is applying slippage and commissions post-hoc as a single flat deduction (e.g., “we assume $0.01 per share slippage”). This is dangerous because it ignores non-linearities.
The Asymmetry of Bad Fills
Slippage is not symmetrical. A strategy with a positive expectancy of 2% per trade might lose 0.5% to slippage. That leaves a net 1.5%. But if the strategy trades during high-volatility events (earnings, news, illiquid periods), slippage spikes to 3%, turning a winning trade into a loser. A fixed slippage model fails to capture this.
The Kelly Criterion and Position Sizing Distortion
Realistic cost modeling directly impacts optimal position sizing. If your backtest assumes zero costs, the optimal Kelly fraction might be 25% of capital. When you add 0.15% per-side in costs, the optimal fraction drops to 10%. Over-leveraging based on a frictionless backtest leads to margin calls, not returns.
How to Stress-Test Slippage & Commissions
To ensure your backtest is realistic, apply a three-tier cost scenario.
- Optimistic Scenario: Minimum observed spread + lowest commission tier (e.g., 0.001 per share spread + $0.005 per share commission).
- Realistic Scenario: Average historical spread + standard commission tier (e.g., 0.02 per share spread + $0.005 per share commission + exchange fees).
- Pessimistic (Survival) Scenario: 200% of the average spread during the worst 10% of trading days + highest commission tier + market impact for 1% of ADV.
If the strategy fails to show a net profit in the realistic scenario, the edge is an illusion. If it fails in the pessimistic scenario, it will likely survive a market shock.
Case Study: The Trend-Following Trap
A classic 20-day moving average crossover backtest on S&P 500 futures showed an annualized return of 14% with zero costs. After applying realistic slippage ($5 per round-turn S&P e-mini micro contract) and average bid-ask spreads (0.15 points), the return dropped to 9%. After introducing market impact for a $1 million account trading 10 e-minis, the return fell to 4%. The strategy was not unprofitable, but the risk-adjusted return (Sharpe ratio) collapsed from 1.2 to 0.35—a non-investable level.
Critical Data Sources for Your Backtesting Engine
Your backtesting engine is only as good as the data you feed it. For accurate slippage modeling, you need:
- Historical Level II Order Book Data: Provides bid/ask for every single tick.
- VWAP Data for Each Bar: Allows you to simulate execution at the aggregate volume-weighted price, not just the close.
- Time and Sales (Tape) Data: Shows every executed trade and its size, enabling queue position modeling.
The Final Filter: Walk-Forward with Realistic Costs
The ultimate test is not a static backtest but a walk-forward optimization where slippage and commissions are recalculated out-of-sample for each forward period. This simulates the experience of placing live trades without knowing the future liquidity profile. A strategy that survives this gauntlet has a statistical edge that can withstand the friction of reality.
The 1% Rule for Intrinsic Sharpness
An industry heuristic: if your strategy cannot survive a 1% per-side penalty (2% round-trip) including slippage, commissions, and market impact, it is statistically weak. Retail traders often fall into the trap of “low frequency, high win rate” strategies that fail precisely because the few trades they take face massive slippage from low liquidity, while high-frequency statistical arbitrage models often degrade gracefully under costs because they trade hundreds of times, averaging out the friction.
Source of Edge vs. Source of Costs
Separate your strategy’s edge from its cost footprint. A strategy that profits from capturing the spread (liquidity provision) has a different cost profile than one that profits from directional momentum. A momentum strategy suffers heavily from market impact; a mean-reversion strategy suffers from adverse selection. Matching the cost model to the alpha source is the only path to a realistic backtest.
The Plumbing of Execution Data
Finally, your backtesting software must handle fractional fills and partial executions. If your model only simulates “all or nothing” fills, it misses the reality of slippage from partial fills. A limit order that gets half-filled before the price reverses is a different cost event than a market order that liquidates the entire position. Good backtests simulate the granularity of exchange order books, not just price series.









