Slippage Assumption in a Backtest
Why Does Slippage Assumption Matter in Backtesting?
Slippage is the gap between the price you expect to get and the price you actually get. You want to buy at $100, but you fill at $100.02. You want to sell at $99, but you fill at $98.98. These tiny differences add up. Over hundreds or thousands of trades, slippage can be the difference between a profitable system and a losing one. This article teaches you how to model realistic slippage in a backtest so your results actually predict real-world trading.
Quick definition: Slippage is the difference between the expected fill price and the actual fill price, caused by bid-ask spread, market impact, and execution delay.
Key takeaways
- Backtests without slippage are optimistic fantasies; real trading has slippage costs.
- Slippage comes from the bid-ask spread, market impact (large orders move prices), and execution timing.
- Fixed slippage (e.g., 0.05% on every trade) is conservative but simple.
- For stocks, 0.01-0.05% slippage is typical; for illiquid stocks, 0.1-0.5%.
- Larger positions have larger slippage; a 10,000-share order impacts the market more than 100 shares.
What Is Slippage?
Slippage happens the moment you place an order. Here's the mechanics:
Bid-ask spread: The bid is what buyers will pay; the ask is what sellers want. If the bid is $100 and the ask is $100.02, the spread is $0.02. If you buy at the ask ($100.02) instead of the bid, you've slipped $0.02.
Market impact: A large order can move the market. If you want to buy 100,000 shares, the price might jump to fill that order. You get the first 50,000 at the original price, the next 30,000 at a higher price, and the last 20,000 at an even higher price. Your average fill is worse than the original price.
Execution delay: Between the time you decide to buy and the time the order executes, the price can move against you. This is especially true in fast markets or on your first trade when the system is slow.
Volatility: In volatile markets, prices jump around. Your limit order to buy at $100 might never fill because the price is either $99.95 or $100.05, but never $100.
Real slippage costs 0.01% to 1% per trade, depending on liquidity, position size, and order type. This doesn't sound like much, but over 100 trades, it's 1% to 100% of the gain.
Modeling Slippage in a Backtest
There are several ways to model slippage in a backtest.
Method 1: Fixed-percentage slippage. "Every entry has 0.05% slippage. Every exit has 0.05% slippage."
If you buy at $100 with 0.05% slippage, you actually pay $100.05. If you sell at $99 with 0.05% slippage, you actually receive $98.95. This is simple and realistic for liquid stocks.
Method 2: Fixed-dollar slippage. "Every entry has $0.01 slippage per share. Every exit has $0.01 slippage per share."
This is less realistic because the slippage as a percentage varies by stock price. A $0.01 slippage on a $100 stock (0.01%) is trivial. The same $0.01 on a $10 stock (0.1%) is significant.
Method 3: Bid-ask slippage. "Model the bid-ask spread. The bid is 1 tick below the closing price, the ask is 1 tick above. Buy at the ask, sell at the bid."
This is more detailed. A "tick" is the minimum price movement. For stocks, 1 tick is usually $0.01. For bigger stocks or illiquid stocks, it can be $0.05 or more.
Method 4: Size-dependent slippage. "Slippage depends on position size. A 100-share order has 0.01% slippage. A 10,000-share order has 0.1% slippage. Slippage scales with order size."
This is the most realistic for larger portfolios because size impacts the market.
Slippage by Market Condition
Different markets and different stocks have different slippage.
Stocks: Liquid large-cap stocks (Apple, Microsoft)
- Typical slippage: 0.01% to 0.03% per trade.
- Bid-ask spread: Usually 1-2 cents on a $100 stock.
Stocks: Mid-cap stocks
- Typical slippage: 0.03% to 0.1% per trade.
- Bid-ask spread: Usually 5-10 cents on a $50 stock.
Stocks: Small-cap or illiquid stocks
- Typical slippage: 0.1% to 0.5% per trade.
- Bid-ask spread: Can be 10-50 cents or more.
ETFs: Highly liquid
- Typical slippage: 0.01% to 0.02% per trade.
- Bid-ask spread: Very tight.
Forex: Major pairs
- Typical slippage: 0.0001 (1 pip) to 0.0005 (5 pips).
- Highly liquid, tight spreads.
Commodities: Futures
- Typical slippage: 0.01% to 0.1% per trade.
- Depends on contract liquidity.
For a stock backtest, assuming 0.05% slippage (entry and exit) is reasonable. For liquid ETFs, 0.02%. For small-cap, 0.1% or more.
Decision tree
How Slippage Compounds Over a Backtest
Let's see the impact of slippage on a 100-trade backtest.
Scenario A: No slippage
- 100 trades, average profit per trade: $100.
- Total return: $10,000.
Scenario B: 0.05% slippage, average position size $50,000
- Slippage per trade: $50,000 × 0.05% = $25.
- Slippage for entry: $25.
- Slippage for exit: $25.
- Total slippage per trade: $50.
- Total slippage for 100 trades: $5,000.
- Return after slippage: $10,000 - $5,000 = $5,000.
Slippage cut the return in half. This is why backtests without slippage are unrealistic.
Scenario C: 0.1% slippage (small-cap stock)
- Slippage per trade: $50,000 × 0.1% = $50.
- Total slippage per trade: $100.
- Total slippage for 100 trades: $10,000.
- Return after slippage: $10,000 - $10,000 = $0.
All the profit is gone. This is why trading small-cap stocks is hard.
Real-World Slippage Examples
Example 1: Large-cap stock (Apple, AAPL)
Entry: Buy 100 shares at $150 (bid-ask spread is 1 cent).
- Expected entry: 100 × $150 = $15,000.
- Actual entry (assume worst case, buy at ask): 100 × $150.01 = $15,001.
- Slippage: $1, or 0.0067%.
Exit: Sell 100 shares at $151 (bid-ask spread is 1 cent).
- Expected exit: 100 × $151 = $15,100.
- Actual exit (assume worst case, sell at bid): 100 × $150.99 = $15,099.
- Slippage: $1, or 0.0066%.
Total slippage: $2. This is minimal.
Example 2: Small-cap stock (illiquid, bid-ask spread is 50 cents)
Entry: Buy 1,000 shares at $30 (bid-ask spread is $0.50, so bid $29.75, ask $30.25).
- Expected entry: 1,000 × $30 = $30,000.
- Actual entry (buy at ask): 1,000 × $30.25 = $30,250.
- Slippage: $250, or 0.83%.
Exit: Sell 1,000 shares at $31 (bid-ask spread is $0.50).
- Expected exit: 1,000 × $31 = $31,000.
- Actual exit (sell at bid): 1,000 × $30.75 = $30,750.
- Slippage: $250, or 0.81%.
Total slippage: $500. On a trade that might profit $500-$1,000, the slippage is 50-100% of the gain.
Slippage and Order Type
The order type affects slippage.
Market order: You accept the current ask (buy) or bid (sell). Fastest fill, worst price. Slippage is the full bid-ask spread.
Limit order: You specify the price you're willing to accept. Better price, but might not fill. If the price never reaches your limit, you don't enter.
Stop order: You place an order that activates if the price hits a level. Can have slippage if the price gaps past your level.
In a backtest, most systems use market orders (immediate fill). This means slippage is at least the bid-ask spread.
Slippage and Position Size
Larger positions have larger slippage as a percentage. A 10,000-share order impacts the market more than a 100-share order.
100-share order: Bid-ask spread absorbs it. Slippage = bid-ask spread.
10,000-share order: Might take multiple ticks to fill all 10,000 shares. If you're buying, the price rises as you buy, and your average fill is worse than the initial ask. Slippage = bid-ask spread + market impact.
In a backtest, a simple fix is to scale slippage with position size. A 10x larger position gets 2-3x larger slippage.
Commission vs. Slippage
Commission is the fee your broker charges per trade (e.g., $5-$10 per trade or 0.1% per trade). Slippage is the cost of execution. They're different but related.
- Slippage: Cost of getting the price you want.
- Commission: Fee paid to the broker.
A realistic backtest includes both. If your broker charges $10 per trade and you have 0.05% slippage, the total cost is $10 + 0.05%.
Common Slippage Mistakes in Backtests
Mistake 1: No slippage assumption. The backtest assumes you fill at the exact price you want. This is fantasy. Add slippage.
Mistake 2: Too-small slippage. Assuming 0.001% slippage on a small-cap stock is unrealistic. Small-cap stocks have 0.1-0.5% slippage.
Mistake 3: Slippage only on entry, not exit. Both entry and exit have slippage. If you only model one, the results are still optimistic.
Mistake 4: Not scaling slippage for position size. A 50,000-share order has more slippage than a 500-share order, but your backtest treats them the same.
Mistake 5: Ignoring overnight slippage. If you enter at the close and hold overnight, slippage on the next day's open could be large (gap risk). Account for this.
FAQ
How do I know the bid-ask spread for a stock I'm backtesting?
Historical bid-ask data is expensive. For testing, use typical spreads: 1 cent for large-cap, 5 cents for mid-cap, 25-50 cents for small-cap. Alternatively, assume slippage as a percentage (0.05%) and let that represent the spread and execution cost together.
Should slippage be the same for entries and exits?
Usually yes. Both have bid-ask spread and market impact. Some traders apply tighter slippage on entries (because they're aggressive) and looser on exits (because they're flexible on price). For simplicity, use the same on both.
What if my strategy is designed to scalp small moves—do I account for more slippage?
Yes. Scalping (entering and exiting within minutes) means you're fighting the bid-ask spread constantly. Assume 0.05-0.1% slippage per trade. With 100 scalping trades per day, slippage kills profitability quickly.
Can slippage vary during the backtest period?
Yes, but most backtests use a fixed assumption. If you want to model realistic slippage, you'd need historical bid-ask data, which is rare. For testing, use a fixed conservative assumption (0.05% for stocks).
If slippage destroys profitability, does the strategy not work?
Not necessarily. It might mean the strategy only works on liquid stocks or with larger position sizes. You'd adjust the entry rules (only trade large-cap) or the position size (larger positions have bigger edge and can absorb slippage). Slippage is a constraint, not a verdict.
What about slippage from commissions and exchange fees?
That's similar to slippage. A $5 commission on a $50,000 trade is 0.01%. A $5 commission on a $5,000 trade is 0.1%. Account for both slippage (bid-ask and market impact) and commissions in the backtest. See the next article on commission and fees for details.
Related concepts
- Defining Rules Before Backtesting — Slippage is part of your overall backtest parameters.
- Position Sizing in a Backtest — Position size affects slippage amount.
- Slippage: Why It Happens — The underlying mechanics of slippage in live trading.
- Backtesting Overview — How slippage affects backtest realism.
Summary
Slippage is the cost of getting a fill. It comes from the bid-ask spread, market impact, and execution timing. In a backtest, never assume zero slippage. For liquid large-cap stocks, 0.01-0.05% is typical. For illiquid small-cap stocks, 0.1-0.5%. Include slippage on both entries and exits. Larger position sizes have larger slippage. Over hundreds of trades, slippage can cut your profit in half or more. A backtest that ignores slippage is guaranteed to overestimate real-world results. Modeled slippage is one of the key factors that separates realistic backtests from fantasies. When you backtest, apply slippage conservatively. If the system is still profitable with realistic slippage, you have something real to trade.