Slippage
Slippage is the difference between the price you expect an order to fill at and the price it actually fills at. A market buy order expected at the last price often fills a little higher; a market sell, a little lower. Stop orders that trigger in a fast move can fill well past their trigger price.
Why it happens
- The spread: a market buy pays the ask and a market sell receives the bid, not the last trade price.
- Order book depth: a large order uses up the best prices and fills the rest at worse ones.
- Speed: in a fast market the price moves between the signal and the fill.
- Gaps: when the price jumps past a stop, the stop fills at the next available price.
Slippage is usually larger on smaller coins, in volatile periods and with larger orders.
Why it matters for backtests
A backtest that fills every order at the exact signal price assumes perfect liquidity. For a strategy that trades often with small gains per trade, realistic slippage can turn a profit into a loss. Slippage should be part of every backtest, never zero.
On Algonney
Every market fill in a backtest includes slippage that starts from the market's own value and can never go below a floor, with separate values for spot and USDT perpetual futures. Each trade shows its raw and executed prices, so you can see the cost of every fill.
Related: backtesting, stop loss and Backtesting. Read also Why your backtest lies.