# Costs and Slippage in Backtests

> Ignoring costs is the fastest way to fool yourself in a backtest. Learn the costs to include, how to estimate slippage and market impact, and conservative rules.

Source: https://learn.tradelabsai.com/research/costs-and-slippage-in-backtests/  
Track: Research and Backtesting · Level: Intermediate · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Costs and Slippage in Backtests", https://learn.tradelabsai.com/research/costs-and-slippage-in-backtests/

Many strategies that look profitable on paper are wiped out by trading costs. Commissions, spreads, slippage, market impact, financing and borrowing fees all reduce returns, and they matter most for strategies that trade often or target small moves. Modelling costs realistically, and conservatively, is one of the most important parts of a backtest. The general cost concepts are covered in [All-In Trading Cost](https://learn.tradelabsai.com/orders/all-in-trading-cost/); this lesson focuses on putting them into backtests.

## Costs to include

| Cost | Applies to | Lesson |
|---|---|---|
| Commissions and fees | Every trade | [Commissions and Fees](https://learn.tradelabsai.com/orders/commissions-and-fees/) |
| Bid ask spread | Market orders and aggressive limit orders | [Spread Costs](https://learn.tradelabsai.com/orders/spread-costs/) |
| Slippage | Difference between expected and actual fill price | [Slippage](https://learn.tradelabsai.com/markets/slippage/) |
| Market impact | Larger orders moving the price | [Market Impact](https://learn.tradelabsai.com/orders/market-impact/) |
| Financing and swap costs | Leveraged and overnight positions | [Financing and Overnight Costs](https://learn.tradelabsai.com/orders/financing-and-overnight-costs/) |
| Borrow fees | Short selling stocks | [Borrow Fees and Stock Loan Costs](https://learn.tradelabsai.com/orders/borrow-fees-and-stock-loan-costs/) |
| Futures roll costs | Rolling contracts | [Roll Costs](https://learn.tradelabsai.com/orders/roll-costs/) |
| Funding rates | Crypto perpetual futures | [Funding Rates](https://learn.tradelabsai.com/crypto/funding-rates/) |
| Taxes | Depends on jurisdiction | [Trading Taxes and Capital Gains](https://learn.tradelabsai.com/industry/trading-taxes-and-capital-gains/) |

## How costs scale with trading frequency

**Example: Turnover kills thin edges**
A strategy earns a gross average of 0.08% per trade and trades 4 times a day. Round trip costs (commission, half spread each way, slippage) average 0.05%. Net edge: 0.03% per trade. If costs are actually 0.08%, the strategy breaks even; at 0.10%, it loses money. A swing strategy earning 2% per trade with the same costs barely notices them. High frequency strategies live or die on cost assumptions. See [Signal Turnover, Breadth and Neutralization](https://learn.tradelabsai.com/research/signal-turnover/).

## Estimating slippage

| Approach | Description |
|---|---|
| Fixed per trade | A set number of ticks or basis points; simple |
| Spread based | Half the typical spread per side, plus a buffer |
| Volatility based | Slippage proportional to recent volatility |
| Volume based (market impact models) | Larger relative to average volume means larger cost |
| Live data | Measure actual fills versus signal prices. See [Slippage Analysis](https://learn.tradelabsai.com/orders/slippage-analysis/) |

A common square root market impact model:

```
impact ≈ k × σ × √(order size / average daily volume)
```

where σ is daily volatility and k a constant often estimated around 0.5 to 1. See [Market Impact](https://learn.tradelabsai.com/orders/market-impact/).

## Conservative rules of thumb

1. **Assume you cross the spread** for market orders and many stops.
2. **Add extra slippage** around open, close and news, when spreads widen.
3. **Do not assume limit orders always fill:** filled limit orders are often the ones the market moved through against you. See [Fill Models, Partial Fills and Order Queues](https://learn.tradelabsai.com/research/fill-models/).
4. **Scale costs with volatility and size.**
5. **Run sensitivity tests** at 1.5 times and 2 times your cost estimate. See [Robustness and Stress Testing](https://learn.tradelabsai.com/research/robustness-and-stress-testing/).
6. **Include financing** for every night positions are held.
7. **Use realistic borrow** costs and availability for shorts; some stocks cannot be borrowed.

## Costs differ by market

| Market | Typical cost features |
|---|---|
| Large cap stocks | Tight spreads; impact matters for large orders |
| Small cap stocks | Wide spreads; high impact |
| Futures | Commissions per contract plus one tick spread in liquid contracts |
| Forex | Spread based; widens in thin hours |
| Options | Wide spreads relative to price; often the dominant cost |
| Crypto | Maker and taker fees; funding; spreads vary by venue |
| Prediction markets | Spread and fees; thin books in small markets |

## Validate with live trading

After launching, compare actual costs with backtest assumptions. Implementation shortfall, the difference between the price when the decision was made and the final execution price, is the standard measure. See [Implementation Shortfall](https://learn.tradelabsai.com/orders/implementation-shortfall/).

## Frequently asked questions

### Why are trading costs important in backtests?

Because commissions, spreads, slippage and financing reduce returns, and they can eliminate the edge of strategies that trade often or target small moves.

### How should I estimate slippage?

Start with half the spread per side plus a buffer, scale with volatility and order size, and refine using actual live fills.

### What is a conservative cost assumption?

Assume you cross the spread, add slippage in volatile periods, include all financing and borrow costs and test at higher cost levels.

Next, learn a fast way to backtest in [Event-Driven vs Vectorized Backtesting](https://learn.tradelabsai.com/research/vectorized-backtesting/).

## Continue learning

- Next lesson: [Event-Driven vs Vectorized Backtesting](https://learn.tradelabsai.com/research/vectorized-backtesting/)
- Previous lesson: [Robustness and Stress Testing](https://learn.tradelabsai.com/research/robustness-and-stress-testing/)
- Related: [Robustness and Stress Testing](https://learn.tradelabsai.com/research/robustness-and-stress-testing/): Robustness tests check whether a strategy survives changes in parameters, markets, costs and conditions. Learn the main tests and how to read the results.
- Related: [All-In Trading Cost](https://learn.tradelabsai.com/orders/all-in-trading-cost/): Your all-in trading cost combines commissions, fees, spreads, slippage, financing and fixed costs. Learn to calculate cost per trade, per unit of risk and per year.
- Related: [Slippage](https://learn.tradelabsai.com/markets/slippage/): Slippage is the gap between the price you expect and the price you get. Learn what causes it, how to measure it and the practical ways to reduce slippage.
- Related: [Market Impact](https://learn.tradelabsai.com/orders/market-impact/): Market impact is the price movement caused by your own trading. Learn temporary and permanent impact, the square root rule of thumb and how large traders reduce it.
- Related: [Fill Models, Partial Fills and Order Queues](https://learn.tradelabsai.com/research/fill-models/): A fill model decides when and at what price backtest orders execute. Learn market, limit and stop fill assumptions, queue position and adverse selection.
- Related: [Transaction Costs](https://learn.tradelabsai.com/orders/transaction-costs/): Transaction costs include commissions, spreads, slippage, market impact and missed trades. Learn each part, how to estimate it and why it decides profits.
