A backtest fills every order at a price the chart printed. A live order fills at whatever the order book offers when it arrives. The gap between those two prices is slippage, and it is the most common reason a strategy that looked clean in the Strategy Tester behaves differently on an exchange. You can’t remove it, but you can model it honestly before going live, measure it after, and keep the execution path between your TradingView alert and the exchange short and predictable. That last part is where we work.
Key Takeaways
- Backtest slippage is an assumption you type in. Live slippage is a measurement, and the two only match when your assumption was realistic.
- Backtesters commonly leave out partial fills, queue position, latency and order rejections, so a zero-slippage run is a best case, not a forecast.
- Measure live slippage in basis points against the price at the moment your signal fired, then compare it with the number your backtest assumed.
- Run the same strategy at optimistic and pessimistic slippage. If it only works at the optimistic end, the edge may be a fill assumption.
- Position sizing, stops and risk rules live in your TradingView strategy. Fast, direct routing of the alert helps keep live fills close to the signal, but it never guarantees a price.
Table of Contents
- What slippage means in a backtest and in live trading
- Why live fills drift away from backtest fills
- A worked example: how a small number eats an edge
- How to model slippage before you go live
- How to measure live slippage against your backtest
- What you can control on the live side
- Our perspective
- Run the same alerts live with Tickerly
- FAQ
- Sources
What slippage means in a backtest and in live trading
Slippage is the difference between the price you expected when the signal fired and the price you actually got. For a buy, a higher fill price is adverse slippage. For a sell, a lower one is.
In a backtest, slippage is a parameter. You pick a number of ticks or a percentage, and the engine applies it to every trade the same way. If you pick nothing, the engine usually assumes you got the price on the chart. In live trading, slippage is an outcome. It depends on the order book depth at that second, how fast the market was moving, how big your order was, and how long your order took to reach the exchange.
That difference in kind is the whole problem. A constant is easy to test and easy to forget. A live distribution has fat tails: most fills are close to the signal, and a few, usually in fast markets, are not.

Why live fills drift away from backtest fills
Slippage is not one thing. Several separate mechanics sit behind it, and a typical backtester skips most of them. The documentation of one backtesting engine lists unmodeled execution mechanics: partial fills, queue position, zero latency between signal and fill, a constant default slippage that does not grow with order size, and order rejections for margin, permissions, rate limits or venue state.
Here is what each one means for a TradingView strategy.
Latency between signal and fill
In the tester, the signal and the fill happen on the same bar, with no time in between. Live, your alert has to be generated, delivered, translated into an order and sent to the exchange, and the market keeps moving while that happens. On a slow, liquid instrument the cost is small. On a fast one it is the largest part of slippage. Our guide to how orders move from signal to fill breaks the path into its steps.
Spread and liquidity
A market buy pays the ask and a market sell hits the bid. If your backtest uses the last traded price, it ignores half the spread on every trade. When your order is larger than what sits at the best price, it walks up the book and fills at progressively worse prices. The same documentation notes that large orders in thin books fill in pieces at worsening prices, while a simple backtest fills them entirely at one price or not at all. Our page on partial fills in trading bots covers how to handle those pieces.
Volatility
Slippage tends to grow when volatility rises, which is exactly when many breakout and momentum strategies trigger. A constant assumption understates the cost on the trades that matter most. Our note on how bots respond to market volatility goes further.
Bar-based data and intrabar order
The Strategy Tester works from bars. It does not know whether the high or the low came first inside a candle, so an entry, a stop and a target can all appear to resolve in a convenient order. Live, the order of events is real. We list these and related gaps in Pine Script Strategy Tester limitations.
Fees, rejections and rate limits
Commissions and funding are separate from slippage, but they sit in the same gap between the tester and the account. An exchange can also reject an order for margin or rate-limit reasons, which a backtest never does. A strategy that trades a lot of small moves is hit hardest, because each extra cost is a larger share of each trade.
If you want the broader mechanics of price drivers, this explainer on what causes slippage and how it is controlled is a good companion read.
A worked example: how a small number eats an edge
Take a hypothetical strategy, for illustration only. It makes 400 trades a year and averages 0.30% gross per trade in the backtest, which assumed no slippage.
| Assumption | Cost per round trip | Net per trade | Share of gross edge lost |
|---|---|---|---|
| Backtest, zero slippage | 0.00% | 0.30% | 0% |
| 0.03% slippage per side | 0.06% | 0.24% | 20% |
| 0.05% slippage per side | 0.10% | 0.20% | 33% |
| 0.10% slippage per side | 0.20% | 0.10% | 67% |
A round trip has two fills, so per-side slippage is paid twice. Fees come on top. The strategy did not change between rows. Only the fill assumption did. This is why a short-timeframe strategy with a thin average trade is the most sensitive to this problem, and why a swing strategy with a large average move per trade barely notices the same slippage.
How to model slippage before you go live
You don’t need a perfect model. You need one that is pessimistic enough that live results rarely disappoint you.
Start with a realistic range for the market you trade
One execution-modeling guide gives typical slippage settings by market: large-cap US equities around 0.01 to 0.02%, small caps 0.1 to 0.5%, E-mini futures about one tick ($12.50 for ES), major crypto pairs on large exchanges 0.02 to 0.10%, and major forex pairs 0.5 to 2 pips. It also advises using slightly more slippage than you think is realistic. Treat these as starting points, then replace them with your own live data once you have it.
In TradingView, the strategy’s properties let you add a slippage value in ticks, and you can set it in the strategy declaration too. Convert your target percentage into ticks for the instrument you actually trade, then rerun.

Make slippage depend on conditions
A flat number is a start. Better models scale the cost. PyBroker’s documentation describes three: a fixed adverse adjustment in basis points, a volatility model that scales the adjustment by the bar’s ATR (average true range, a measure of how far price typically moves per bar), and a volume model that caps fills at a share of bar volume and adds price impact as your order grows. You can approximate the same idea in Pine Script by making the penalty a multiple of ATR instead of a constant.
Run a best case and a worst case
The same guide recommends running the strategy twice: once with optimistic fills and zero slippage, and once with pessimistic fills and high slippage. Its reasoning is that profitability across the full range is strong evidence of a real edge, while a strategy that only survives the best case depends on perfect fills. Our checklist on testing strategy robustness puts this next to parameter sweeps and out-of-sample checks, and effective backtesting covers the wider validation process.
Keep order size honest
If your backtest trades size you could never get filled live, no slippage setting will rescue it. The same guide suggests capping volume at 10% of bar volume or lower. For small accounts this rarely binds. For larger ones in thin crypto pairs or small caps, it binds quickly.
How to measure live slippage against your backtest
Modeling is a guess until you compare it with fills. The method is simple, and the discipline is in doing it consistently.
- Record the reference price. Use the price at the moment the signal fired: the close of the signal bar for a bar-close strategy, or the alert trigger price. This is the “arrival price” in professional trading-cost analysis.
- Record the average fill price. If an order filled in several pieces, use the average across them.
- Compute slippage in basis points. The standard form is (average fill price minus reference price) divided by the reference price, with the sign flipped for sells so that a positive number always means a worse outcome. This is how Proof Trading’s published cost-analysis method defines it, aggregated across orders weighted by notional.
- Compare by condition, not only on average. Split by time of day, volatility and order size. Deutsche Bank’s quant research notes that standard analysis ties cost to order size, participation, spread and volatility, and those are the same splits that will tell you where your backtest assumption fails.
- Feed the result back. Replace your assumed slippage with the observed median and a higher percentile, and rerun the backtest.
Two cautions on benchmarks. Measuring against the arrival price is clean but noisy. Measuring against a volume-weighted average price is smoother but circular, because your own trading moves that average, as Proof’s documentation points out. For a small bot order, arrival price is the more honest yardstick.
One more point from the same Deutsche Bank research: analysis explains where slippage comes from but does not by itself reduce it, because few of the explanatory variables are things you can control. The levers you do control are order size, the market and hours you trade, and how quickly your alert reaches the exchange.
To test without risking capital, use the exchange’s demo account where one exists, and treat its fills as a rough guide only, since demo order books are often not the real thing. Then move to small live size and keep the log.
What you can control on the live side
Once you know your real number, three levers matter for a TradingView automation.
- Execution path. Every step between the alert and the exchange adds time. Fewer hops and no self-managed server in the middle means less drift. Our guide to measuring p50 and p95 latency shows how to check the median and the tail yourself.
- Trading hours and instruments. Avoid thin sessions and wide-spread pairs if your edge is small.
- Strategy design. Entries on bar close behave differently from entries on every tick. Position sizing, stops and risk rules are defined in your TradingView strategy, so that is where size and exits should be tuned to the slippage you measured.
For a comparison of tactics, see how to reduce slippage in trading bots. To compare delivery speed before committing to any tool, read how to measure round-trip latency.
Our perspective
We think the honest way to treat slippage is as a cost you budget for, not a surprise you discover on the first live week. A backtest tells you whether an idea has structure. It cannot tell you what the exchange will charge to act on it.
That is why we focus on the part of the chain we can shorten: the trip from a TradingView alert to an order on your exchange. Tickerly turns your strategy’s alerts into live orders within a fraction of a second, with no VPS to maintain and no code to write, and it handles unlimited strategies and alerts. Your strategy still defines the entries, exits and sizing, and the market still decides the price.
Our advice is to give your backtest a pessimistic slippage number, take the first month of live fills seriously, and adjust the strategy from what you measure.
Jay
Run the same alerts live with Tickerly
If your strategy already survives a pessimistic slippage setting, the next step is getting its alerts to your exchange quickly and consistently. Tickerly connects TradingView alerts to supported exchanges, forex and stock brokers, and MetaTrader 4 and 5, with a no-code setup. MetaTrader connections need your own MetaTrader terminal running.
Every plan starts with a 30-day free trial, and paid plans begin at 19 USD per month for Level 2, with Level 3 at 29 USD and Level 4 at 39 USD per month. See the plans or follow the step-by-step TradingView setup.
FAQ
What is a normal gap between backtest and live results?
There is no universal figure, because it depends on the market, order size and strategy speed. Short-timeframe strategies with thin average gains usually show the biggest gap, since each fill is a larger share of the trade. Measure your own slippage in basis points and rerun the backtest with it.
Does zero slippage in the TradingView tester mean my live fills will match?
No. Zero slippage is a best-case assumption. It ignores spread, latency, partial fills and rejections. Add a realistic penalty, then test optimistic and pessimistic versions of the same run.
Can slippage be positive?
Yes. Price can move in your favor between the signal and the fill, which shows up as a better fill. Over many trades the average is normally adverse for market orders, so model it as a cost and treat favorable fills as noise.
How many live trades do I need before trusting my slippage estimate?
There is no fixed count, but you need enough fills across calm and volatile periods to see the tail, not just the median. Track the median and a high percentile separately, and update your backtest assumption as the sample grows.
Sources
- Backtest limitations, Stretus Documentation
- Execution Modeling, Stratifyre Docs
- Modeling Slippage, PyBroker
- Proof’s Design for Public-facing TCA
- DB Quant Research, TCA Extensions
- Slippage Explained: What It Is and How to Control It
Recommended
- How to Reduce Slippage in Trading Bots: 6 Methods Compared
- Partial Fills in Trading Bots: Track 5 FIX Fields, Prevent State Bugs
- Real-Time Trade Execution: How Orders Move From Signal to Fill
- Effective Backtesting: How to Validate Your Trading Strategies
This article was produced with Al assistance and reviewed for accuracy. It is provided for general information only and is not professional or financial advice.

