Backtesting Arena

Backtesting Arena

Back to blog

The Gap Tax: Your Daily Backtest Fills at a Price You Can't Trade — How Big Is the Error Really?

Daily backtests compute the signal from the close and fill at that same close — a price you can no longer trade. We recomputed 7,000+ trades twice (close fill vs. next open) to size the distortion. Result: smaller than the myth.

Backtesting Arena·July 14, 2026·5 min read·0 views
The Gap Tax: Your Daily Backtest Fills at a Price You Can't Trade — How Big Is the Error Really?

There's a subtle optimism baked into almost every daily backtest, and almost nobody measures it.

A daily strategy computes its signal from the closing price — and then fills at that same close. The problem: you only know the close after it's set. At that moment you can no longer trade it. Realistically you fill at the next open at the earliest. In between sits the overnight (and on weekends, the weekend) gap — and it distorts the result.

We call that difference the gap tax. And we measured it instead of asserting it.

The setup

Two fill models, on exactly the same signals (the strategy logic is untouched):

Fill modelFill priceMeaning
Close filldaily close Cᵢthe usual (optimistic) backtest default
Next-open fillnext open Oᵢ₊₁the tradable reality — gap included

Gap tax = performance(close fill) − performance(next-open fill), per strategy × asset, slippage-free.

Computed on the three free strategies (RSI/SMA, Golden Cross, RSI OB/OS), daily bars, across top-10 stocks, top-10 ETFs, and eight liquid crypto pairs as the control group — over 7,000 round-trip trades in total.

Why crypto is the control group

Crypto trades 24/7. No market close means no close→open gap; the next candle's open is essentially the last candle's close. So crypto must produce a gap tax of ≈0. If it doesn't, the math is broken (an off-by-one in the bar indexing). Crypto is both the honest lesson and the self-test of the method.

Asset classRound-tripsMedian gap/tradeMedian CAGR Δ
Stocks2,590−0.02 pp+0.44 pp
ETFs2,655−0.05 pp−0.04 pp
Crypto (control)2,013+0.00 pp+0.00 pp

The self-test passes: crypto returns exactly 0.00. The method measures what it's supposed to.

The surprising result: the gap tax is almost zero

We went into this expecting stocks and ETFs to show a noticeable gap tax — they have real overnight gaps, after all. The data says otherwise:

  • The median CAGR distortion is under half a percentage point per year (stocks +0.44 pp, ETFs −0.04 pp).
  • The per-trade gap is essentially zero at the median (−0.02 to −0.05 pp).
  • The share of trades where the gap ran against the strategy is ~51% — a coin flip.

Does that mean stocks have no overnight gaps? No — and this is where it gets interesting. The gaps are real and not small: the interquartile range for stocks runs from −0.79 to +0.70 pp per trade. Individual trades do get shifted by ±0.7 pp. But that shift is symmetric. Sometimes the gap helps you, sometimes it hurts you, and across many trades it almost entirely cancels out.

Compare crypto: there the interquartile range is just −0.01 to +0.01 pp — there's simply no gap. That exact contrast (stocks: large, symmetric gap noise; crypto: no gap) confirms the method computes correctly.

What this means — and what it doesn't

The honest finding: on daily bars, with strategies that hold for several days, the close-fill optimism is per-trade noise, not systematic result inflation. The widespread assumption that "daily backtests are meaningfully flattered by close fills" doesn't survive measurement — at least not for this strategy class and timeframe.

The reason is intuitive once you see it: if a trade is held for 20 days and moves 15%, an overnight gap of ±0.3% at entry and exit is noise. For a trade that holds a single bar, the same gap would dominate.

What we explicitly are NOT saying:

  • That gaps are irrelevant. Per individual trade, ±0.7 pp is real. If you run few trades, you feel the variance.
  • That this holds for every timeframe. Intraday strategies, short-hold setups, or illiquid names with large gaps can have a real, directional gap tax. Measured here: daily + multi-day holds.
  • That execution costs don't matter. This analysis deliberately leaves out slippage and fees to show the gap in isolation. Both are a separate, real line item.

What Backtesting Arena contributes here

We don't claim to be the only honest backtesting platform. What we do: form a hypothesis, measure it against real data, and publish the result — even when it contradicts our own expectation. The gap tax was framed as an "aha, here's the hidden distortion" story. The data turned it into a "here's how big it actually is, namely barely" story. Both are methodological honesty.

The next step, if there's demand: a fill-realism card directly in the backtest result that shows close fill and next-open fill side by side — so you see it per run instead of taking our word for it.

FAQ

What is the gap tax in one sentence? The difference between filling (unrealistically) at the close the signal was computed from, and filling (realistically) at the next open — measured as a performance difference.

Why is it almost zero for stocks if overnight gaps exist? Because the gaps are symmetric. ±0.7 pp per trade, sometimes for and sometimes against the strategy — across many trades it cancels. The per-trade noise is real; the median systematic distortion is not.

Why is crypto the control group? 24/7 markets have no close, hence no close→open gap. Crypto MUST return ≈0 — if it doesn't, the bar indexing is wrong. Our crypto value is exactly 0.00, so the self-test passes.

Does this mean I can ignore fills entirely? No. For short-hold or intraday strategies, illiquid names, or with few trades, the gap can bite. We measured daily strategies with multi-day holds — there it's a wash.

Are slippage and fees included here? No, deliberately. This analysis isolates the gap. Slippage and fees are a separate, real cost line we treat on their own.

Can I reproduce this myself? The method is openly described: compute the signal at the close, fill once at the close and once at the next open, take the difference, aggregate across many trades and assets — with a 24/7 market as the zero control.

Try it yourself

Run the backtest with your own parameters and time ranges.

Run backtest →
📬

Don't miss new blog posts

One short email per new post — strategies, backtests, market analysis. No spam, unsubscribe with one click anytime.

By subscribing you accept our privacy policy. We use Resend for delivery. Double opt-in confirmation required.

Comments (0)

Join free to post comments.

Sign up →

No comments yet. Be the first!