StrategyLab

Blog / 30 Sep 2026

Fees, slippage and the next open: three assumptions that decide a backtest

The same rule on the same prices can win or lose depending on what a trade costs, what price it gets and when it fills. Here is what each assumption does to a result.

Two backtests of the same rule on the same prices can disagree by ten points of return. The difference is rarely the strategy. It is three assumptions about how an order becomes a trade: what it costs, what price you get, and when you get it.

Fees: small, and charged every time

StrategyLab charges a fee on every buy and every sell. The default is 0.1% per side. A round trip (in and out) therefore costs 0.2% before anything else happens.

How much that matters depends on how often you trade. On two years of daily Bitcoin candles with default settings:

Strategy Trades No costs Default costs
SMA crossover 20 / 50 9 +10.00% +7.23%
EMA crossover 12 / 26 13 +6.22% +2.31%
MACD 12 / 26 / 9 30 +7.30% −1.79%

The MACD strategy is a modest winner in a world without costs and a loser in this one. Nothing about its signals changed. Thirty round trips at roughly 0.3% each is nine points of return, gone.

Slippage: the price you see is not the price you get

A market order fills at whatever the market offers when it arrives, which is usually a little worse than the last quoted price. StrategyLab models this by moving every fill against you by a percentage: 0.05% by default. Buys fill slightly higher, sells slightly lower.

For large, liquid pairs on a major exchange, a few hundredths of a percent is a reasonable starting point for small orders. For thin markets, large orders or fast moves it can be much more. If you are unsure, test with double your estimate. A strategy that only works with perfect fills does not work.

The next open: no trading on prices you could not have known

This is the assumption that quietly ruins the most backtests. A daily candle’s closing price is only known when the day is over. A rule such as “buy when the 20-day average crosses above the 50-day” can only be evaluated after that close, so the earliest honest fill is the next candle’s open.

A backtest that fills at the same close it used to make the decision is trading on information it did not have yet. This is called look-ahead bias, and it makes almost any rule look better than it is. StrategyLab’s engine never does this: a strategy reads a candle only once it has closed, and the order fills at the next open, with slippage and fee applied. One of its unit tests runs a strategy on the first 600 candles of a history and checks that the result matches the first 600 candles of the full run exactly. If the future leaked in, they would differ.

Trade list with nine trades showing entry date and price, exit date and price, size, profit or loss in dollars and percent, candles held, and the reason each trade closed.
Every simulated trade, with entry and exit fills. Example data.

Stops and gaps

A stop-loss at 5% does not guarantee a 5% loss. If a candle opens beyond your stop, the fill is at the open, which can be much worse. StrategyLab checks stops inside each candle using its high and low, fills a gapped stop at the open, and when one candle touches both the stop and the take-profit it assumes the stop came first. That is the pessimistic choice, and the right one when you cannot see inside the candle.

What to do with this

  1. Set the fee to what your exchange actually charges you, not the headline rate.
  2. Run the test again with slippage doubled. If the result collapses, it was never robust.
  3. Be suspicious of strategies that trade often on small candles. Costs scale with the number of trades; edges do not.
  4. Compare against buy & hold with the same costs. StrategyLab does this for you.

The Trading rules panel in the tool has a slider for each of these. Move the fee from 0.1% to 0.3% on a strategy you like and watch what happens to the first sentence of the result.

The figures in this article are simulated results from one example: real BTC-USD daily candles from Coinbase Exchange, 1 Oct 2024 to 29 Sep 2026, $10,000 starting cash. Hypothetical performance has limits and is not a guarantee of future returns. Educational use only, not investment advice. See the risk disclosure.

The example is already loaded.

Open the tool and it is running an SMA crossover on two years of real Bitcoin prices. Change one setting and watch the result move. No account until you save.

Try it freeSee pricing

Simulated results. Hypothetical performance has limits and is not a guarantee of future returns. Educational use only, not investment advice. Risk disclosure