Skip to content
Wildflower
Join waitlist

Slippage and commissions in a backtest: how costs are counted

By Bec, futures trader and founder of Wildflower · Updated

A backtest has to guess the price each order would have filled at, and what each trade cost. Slippage is an allowance of a few ticks worse on orders that fill at market. Commissions and fees are taken off each trade in dollars per contract, turning the gross result into the net one.

Target 102.25With 1 tick of slippage: 100.50With no slippage: 100.25
Target 102.25Filled 100.50No cost 100.25

What slippage and commissions are in a backtest

A runs your rules over past prices and books every trade they would have taken. It has to answer two questions for each trade: what price would each order have filled at, and what did the trade cost?

Slippage is the first answer. is the difference between the price you expected and the price you got. A backtest adds it as an allowance, usually a number of worse on each order that fills at market.

Commissions and fees are the second. Your broker and the exchange charge for every contract you trade. A backtest takes them off each trade, in dollars per contract.

The result before fees is the result. After fees, it’s the result. A backtest that shows both lets you see exactly what the costs took.

How a backtest books one trade, step by step

SignalNext open 100.25

1. The signal and the next price

The rules fire at a candle’s close, 100.00. The first price after that is the next open, 100.25.

Filled 100.50

2. Add slippage

A market buy is booked 1 tick worse: 100.50. That’s the allowance.

Target 102.25

3. Book the exit

The target is a limit order at 102.25. It fills at its own price once a candle trades through it.

Gross +$35Fees −$4Net +$31

4. Take off fees

7 ticks at $5 is +$35 gross. Take off $4 of fees for the round trip: +$31 net.

All the numbers here are made up, on a made-up contract that moves in 0.25 steps worth $5 each. With no slippage and no fees, the same trade would show 8 ticks, +$40. The rules and the candles didn’t change. Only the costs did.

How a backtest models slippage

Fast candleStop 99.25Filled 99.00Booked 1 tick past the stop.
Opened past the stopStop 99.25Filled 98.50Booked at the open, 98.50.

Different orders slip differently, so a careful backtest treats them differently:

  • Market orders take the next price available. A backtest books them a set number of ticks worse than the price it expected.
  • Stop orders turn into market orders when price reaches them, so they can fill past their price. A backtest can book them a tick or more past. If a candle opens beyond the stop, it can book the open instead, as in the second picture.
  • Limit orders never fill worse than their price. So there’s no slippage on them, but there’s a different question: did they fill at all? That’s the next section.

The is a cost of its own. A buy at market pays the ask and a sell pays the bid, while a candle chart shows the prices that traded. Some backtests add a tick for it. Others count it inside their slippage. Read about the bid-ask spread.

Which fills a backtest counts

Only touched✕Target 102.25High 102.25: not filled.
Traded through✓Target 102.25High 102.50: filled at 102.25.
Both in one candleTarget 102.25Stop 99.25Counted as the stop.

A touch isn’t a fill. A limit order waits in a queue at its price. If price only touches it and turns, orders ahead of yours may take all the trading there. So some backtests only count a limit fill when price trades at least a tick through it.

Both in one candle. A candle shows its high and low but not which came first. When it reaches both the stop and the target, a careful backtest assumes the worse one: the stop. A smaller candle size can settle it. Read about timeframes.

How commissions and fees are counted

A futures trade pays several charges: the broker’s , the exchange’s fee, and small regulatory fees. Together they’re quoted in dollars per contract. There are two ways to quote them, and mixing them up is easy:

  • Per side. The charge for buying or selling once. Say it’s $2.
  • Round trip. The charge for going in and coming out, both sides together. At $2 per side, that’s $4 for the .

Fees are charged per contract, whatever the trade makes or loses. So they grow with the number of contracts, not with how big the move is. With the same made-up numbers:

  • 1 contract, the trade above: +$35 gross, $4 fees, +$31 net.
  • 5 contracts, the same trade: +$175 gross, $20 fees, +$155 net.
  • 1 contract, a 2-tick win: +$10 gross, $4 fees, +$6 net.
  • 1 contract, a 6-tick loss: −$30 gross, $4 fees, −$34 net.

Micro contracts have smaller tick values, but their fees per contract aren’t smaller by the same amount. So, for the same move in points, fees take more of each trade on a micro. Check your own broker’s fees for each contract you trade.

Why small costs add up

Ten trades: before and after feesBefore fees +$35After fees −$5$0

Each cost is small on one trade. Over many trades, they add up. In this made-up run of ten trades, the result before fees is +$35. Ten round trips at $4 is $40, so the result after fees is −$5. Same trades, same prices, a different answer.

Slippage adds up the same way. One extra tick on every entry, at $5 a tick, is $50 over ten trades on one contract. Rules that trade often, or aim for small moves, feel costs the most.

How traders choose what to add

There’s no single right amount of slippage or fees. A few ways traders decide:

  • Fees from their broker. Many brokers publish their fees per contract. Traders add the round-trip total.
  • Slippage from their own fills. Traders who have traded live compare the prices they got with the prices they expected, and use that.
  • More than they expect. Some add an extra tick or two, so the test isn’t built on the best case.
  • With and without. Some run the same test twice, to see how much of the result depends on the costs.

Whatever you choose, a backtest result is only as honest as its assumptions. Many traders write them down next to the result. Read about why backtest and live results differ.

Often confused with

Slippage and the spread. The spread is the gap between the bid and the ask at one moment. Slippage is how far your fill landed from the price you expected. They’re related, but they’re not the same thing. Read about slippage.

Per side and round trip. A fee per side is charged twice on every trade. A round-trip fee already counts both.

Trading fees and other costs. Platform, data and account fees are charged by the month, not per trade. They don’t belong in each trade’s fees, though they still cost you.

Latency. The delay before your order reaches the market. It’s one cause of slippage, not a cost of its own. Read about latency and live results.

Setting fees and slippage in Wildflower’s Backtest

Choose your own fees, and see gross and net side by side

In Wildflower’s Backtest you choose your fees in Fees and slippage: your broker’s published fee, a fee you type in dollars per contract for the round trip, or none. Slippage is the Bot’s own: market orders fill 1 tick worse, stops fill 1 tick past, and targets fill only if price trades through. Under More, you can add extra ticks of your own. Results show profit after fees with profit before fees beside it, and every result says what it assumed. No coding needed.

A Backtest chart with a trade’s stop and target drawn as shaded boxes, and a line you drag to ask why a candle had no trade.

Free on a practice chart

Common questions

What is slippage in a backtest?

An allowance for filling at a worse price than expected, in ticks. Without it, a backtest assumes every market and stop order filled at the exact price.

How much slippage should I add to a backtest?

There’s no single right amount. Some traders use their own live fills. Others add an extra tick or two on top.

Do limit orders have slippage?

No. A limit never fills worse than its price. The question for a limit is whether it filled at all.

What does round trip mean for fees?

Both sides of a trade together: in and out. A $2 fee per side is $4 for the round trip.

Are commissions charged per contract?

Yes, for futures. Five contracts pay five times the fee, whatever the trade makes or loses.

What is the difference between gross and net profit?

Gross is before fees. Net is after fees. Many results show both, side by side.

Does a backtest include the spread?

Only if the tool includes it, as its own tick or inside its slippage.

Why is my backtest different after adding fees?

Fees come off every trade. Small wins can turn into small losses, and the total can change sign.

Do stops slip in a backtest?

Only if the backtest models it. A stop turns into a market order, so a careful model books it a tick or more past its price.

Learn it step by step in Wildflower Trading School, starting with the lesson “Spread and slippage”.

In the help centre