DeskTested

Trading tools, tested on a real desk.

Updated Nov 23, 2026Desk NotesClaims verified ✓Anthony M.

Backtest Parameter Optimization: Our Smooth VIX-Gate Curve Was Still Overfit

A backtest parameter sweep that improves smoothly at every step can still be overfit. Our VIX-gate sweep did, and its best setting failed on 2020–2023.

A backtest parameter sweep that improves smoothly at every step can still be overfit. A smooth curve rules out one lucky setting, but it doesn’t show the effect holds on data the parameter wasn’t chosen on. Our own opening range breakout study is the worked example: as its VIX filter tightened, return, Sharpe ratio and drawdown all improved at every step. Then the chosen setting’s Sharpe fell from 1.94 to 0.33 on four years it wasn’t tuned on.

This page shows the sweep table as the research record printed it, the checks we ran on it, and two questions to ask of any optimizer result before trusting its best row.

Every return, Sharpe ratio, drawdown and trade count below is a backtest simulation: not live results, not a prediction, not advice. All of them are copied from a desk research record (orb_results.md, run 2026-07-01) as quoted in our desk log. No positions, signals or account values appear on this page.

The sweep: one filter, five settings

The strategy was an intraday opening range breakout (ORB) on QQQ, traded in both directions on 5-minute bars. The study’s test, as its header states it: window 2024-01-01 to 2026-06-30 (625 trading days), cost 2.5 bps per side, Alpaca SIP 5-minute bars. The filter being swept was a VIX gate, described in the record as “Gating ORB to only trade when the prior-day VIX exceeds a threshold (both directions)”. The record’s table, verbatim:

VIX gate trades total ret Sharpe max DD 2026 return 2026 trades
none 619 +2.9% 0.18 −29.8% −19.7% 123
≥20 124 +5.0% 0.42 −24.5% −8.8% 37
≥22 75 +15.6% 0.99 −17.7% −2.5% 25
≥25 37 +23.8% 1.94 −12.8% +2.8% 14
≥28 18 +26.1% 2.98 −6.0% +2.5% 3

Backtest simulation over 2024-01-01 to 2026-06-30 at 2.5 bps per side: not live results, not a prediction, not advice.

The record read the table as proof the effect was real:

Monotonic improvement across the whole gate curve (return↑, Sharpe 0.18→3.4, DD −30%→−6%) — a real regime effect, not a cherry-pick. Crucially, the gate does not merely sit out 2026: at VIX≥25 it still took 14 trades in 2026 and turned the year from −19.7% to +2.8% — a genuine holdout signal.

That’s the standard argument, and much of the advice on parameter optimization makes it: a fitted artifact spikes at one value and collapses on either side, while a real effect shows up as a smooth trend. On the question of a single lucky setting, the argument is right. It doesn’t settle anything else.

Bar chart of backtest Sharpe ratios for the ORB strategy by VIX gate: none 0.18, ≥20 0.42, ≥22 0.99, ≥25 1.94 and ≥28 2.98 over 2024 to mid-2026, against 0.33 for the ≥25 gate on 2020 to 2023 after correction

What we checked in the table

We checked the record’s claims against its own table and against public VIX data. The arithmetic on the table is below, run as shown:

# Arithmetic on the study's VIX-gate table (orb_results.md, 2024-01-01 to 2026-06-30)
rows = [  # gate, trades, total_ret %, sharpe, max_dd %, ret_2026 %, trades_2026
    ("none", 619,  2.9, 0.18, -29.8, -19.7, 123),
    (">=20", 124,  5.0, 0.42, -24.5,  -8.8,  37),
    (">=22",  75, 15.6, 0.99, -17.7,  -2.5,  25),
    (">=25",  37, 23.8, 1.94, -12.8,   2.8,  14),
    (">=28",  18, 26.1, 2.98,  -6.0,   2.5,   3),
]
def improves_every_step(col):
    vals = [r[col] for r in rows]      # max DD is negative, so shallower is also larger
    return all(b > a for a, b in zip(vals, vals[1:]))

for name, col in [("total return", 2), ("Sharpe", 3), ("max drawdown", 4), ("2026 return", 5)]:
    print(f"{name:13s} improves at every step: {improves_every_step(col)}")
# total return / Sharpe / max drawdown: True     2026 return: False

for gate, trades, *_ in rows[1:]:
    print(f"{gate}: keeps {trades} of 619 trades ({trades / 619:.1%})")
# >=20: 20.0%   >=22: 12.1%   >=25: 6.0%   >=28: 2.9%

print("highest Sharpe in the table:", max(r[3] for r in rows))   # 2.98, not 3.4

Four things came out of it.

  • “Monotonic” holds for three columns, not four. Total return, Sharpe and maximum drawdown improve strictly at every step. The 2026 return doesn’t: +2.8% at ≥25, then +2.5% at ≥28.
  • The “Sharpe 0.18→3.4” in the record’s paragraph doesn’t match its table. The highest Sharpe in the table is 2.98, at ≥28. The caveats line mentions a ≥30 gate, so a ≥30 run may have existed and been left out of the table. That’s our inference from the text; the record doesn’t say so.
  • The best rows rest on very few trades. The ≥25 gate keeps 37 of 619 trades (6.0%) and the ≥28 gate keeps 18 (2.9%). The ≥28 row’s 2026 return comes from 3 trades.
  • The trade counts are real. Over the study’s 625 sessions, we counted how many had a prior-day VIX close at or above each gate, using public Yahoo data. In 2026 the counts were 37, 25, 14 and 3, exactly the study’s 2026 trade counts. Over the full window they were 125, 76, 38 and 18, within one of the study’s 124, 75, 37 and 18. That fits at most one trade per qualifying session. The thin rows aren’t a bug: high-VIX days were rare in this window.

Why the smooth curve still misled

The record’s own caveat line names the problem. On the ≥25 gate it says: “threshold suggested by this same sample”. The threshold was picked by looking at 2024 to mid-2026, and the curve was drawn on the same 2024 to mid-2026. That makes the whole curve in-sample.

That also answers the “genuine holdout signal” claim. The 2026 columns fall inside the study’s window, 2024-01-01 to 2026-06-30, so 2026 is part of the sample the threshold was chosen on. It isn’t a holdout. A tightening filter also has a built-in way to look smooth: each step keeps a subset of the previous step’s trades. If the trades that survive a tighter gate happened to be the good ones in this sample, every column improves together, whatever happens outside the sample.

The real test came when the record’s planned extension ran the ≥25 gate over 2020–2023. Getting there exposed a data bug that had silently deleted 2020 and early 2021, which is told in full in how a silent data gap turned +5.0% into +64.6%. After the correction, the same gate returned +5.0% with a Sharpe of 0.33 and a −54% maximum drawdown over 2020–2023. The study concluded the edge “does NOT generalize”.

VIX ≥ 25 gate Window Trades Total return Sharpe Max drawdown
Tuning sample 2024-01-01 to 2026-06-30 37 +23.8% 1.94 −12.8%
Not tuned on (corrected) 2020–2023 — +5.0% 0.33 −54%

Backtest simulations of the same ORB rule with the same VIX gate, 2.5 bps per side: not live results, not a prediction, not advice. The trade count for 2020–2023 isn’t quoted here; the per-year counts are in the linked post.

The curve was smooth, and it still didn’t carry over.

What a smooth sweep does and doesn’t tell you

A smooth sweep is evidence against one specific failure: a lone setting that works by accident while its neighbours fail. That’s why our validation sequence treats a plateau across neighbouring settings as “at least a candidate for an effect”, not as a pass. It is not evidence against these:

Failure Does a smooth sweep rule it out? What does
One lucky parameter value Yes The sweep itself
Parameter chosen on the same data it’s scored on No Re-running the sweep on a period it wasn’t tuned on
Best rows resting on a handful of trades No Reading the trade count beside every row
Effect tied to one market regime No A second window with different conditions
Data defects in part of the window No Coverage checks before the run

The ORB sweep hit the second and third rows at once: it was tuned in-sample, and its best rows had 37 and 18 trades. On the fourth, the record’s own verdict after the 2020–2023 run was that the gate amounted to “a bet on which type of volatility shows up, not a durable edge.”

Two questions for any optimizer result

Many backtesting tools and strategy marketplaces present a parameter sweep or an “optimized” setting. Whatever tool produced it, two questions decide how much the best row is worth.

How many trades sit behind the best row?

Tightening a filter almost always shrinks the sample. Put the trade count next to every row, and be most suspicious of the rows that look best. In the ORB sweep the Sharpe rose from 0.18 to 2.98 while the trade count fell from 619 to 18.

Was the sweep re-run on a period it wasn’t tuned on?

If every row of the sweep comes from the window used to pick the parameter, it’s an in-sample result, however smooth it looks. A sub-period inside that window, like 2026 here, doesn’t count as a holdout. The check that mattered for this study was a different window, and it changed the verdict.

Here is a simplified sketch of how to report a sweep so both questions answer themselves:

# Illustrative only: a sweep report that puts trade counts and an untouched window
# beside every row. `backtest` is any function returning a dict of metrics.
def sweep_report(backtest, gates, tune_window, check_window, min_trades=100):
    report = []
    for g in gates:
        tuned = backtest(gate=g, window=tune_window)
        check = backtest(gate=g, window=check_window)   # never used to pick g
        report.append({
            "gate": g,
            "trades": tuned["trades"],
            "thin": tuned["trades"] < min_trades,       # threshold is a policy choice
            "sharpe_tuned": tuned["sharpe"],
            "sharpe_check": check["sharpe"],
        })
    return report

Frequently asked questions

Does a smooth optimization curve mean a backtest isn’t overfit?

No. It shows the result doesn’t depend on one lucky parameter value. If the parameter was chosen on the same data the curve is drawn on, the curve is still in-sample. Our ORB study’s VIX gate improved smoothly from Sharpe 0.18 to 2.98 over 2024 to mid-2026, then its chosen ≥25 setting returned a Sharpe of 0.33 on 2020–2023 (backtest simulations, 2.5 bps per side; not live results, not a prediction, not advice).

How many trades does a backtest need?

There’s no universal number, and this page doesn’t propose one. Report the count beside every result and be wary when the best rows have the fewest trades. In our sweep the two best rows rested on 37 and 18 trades out of 619.

Is a recent year inside the backtest window a valid holdout?

No. If the year falls inside the window used to choose the parameter, it influenced the choice. The ORB record called its 2026 result “a genuine holdout signal”, but 2026 sat inside its 2024-01-01 to 2026-06-30 window.

What is the best way to test an optimized parameter?

Re-run the same sweep on a period that played no part in choosing the parameter, preferably one with different market conditions, and check the trade counts and data coverage in that window too. Walk-forward testing does this on a rolling basis.


Sources: desk research record orb_results.md (run 2026-07-01), quoted in pipeline/desk-log/2026-W47.md (sweep table and desk checks) and 2026-W36.md (the corrected 2020–2023 figures).

This is educational content about research methodology, not financial advice. Every return, Sharpe ratio, drawdown and trade count above comes from a historical backtest simulation over a stated window. None is a live result, a prediction or a recommendation to trade any strategy.