The Parameters Were Chosen on the Whole Sample: Holdout Sharpe +0.09, Every Neighbour Negative

Part 1 of this series fixed a one-line look-ahead bug (shift(-1)) that had turned a losing strategy into a Sharpe 1.16. Part 2 added the missing cost stack — 7 bps per side, next-bar-open fills — and the corrected strategy landed at -22.04% total return, Sharpe -0.32, max drawdown -41.58%.

This final part asks the question that remains after the code is honest: were the parameters ever evidence, or were they just the best-looking point on the data they were tested on?

A note on the data, same as parts 1 and 2: the price series is synthetic — a seeded random walk, 1,500 daily bars, generated by the audit script itself (demo_audit.py, numbers in results.json). Every figure below reproduces exactly. The strategy is a plain 5/20 moving-average crossover.

Failure 1: no holdout was ever reserved

The submitted run selected its parameters (5/20) on the full sample and then reported performance on that same sample. That is grading an exam with the answer key open: the selection step has already seen every bar the evaluation step will use.

The corrected audit splits the sample before judging anything:

Segment Total return Sharpe Max drawdown
In-sample (first 70%) -20.46% -0.39 -41.58%
Holdout (last 30%, untouched during selection) +1.38% +0.09 -7.99%

Read the holdout line carefully. +0.09 Sharpe on 30% of the sample is not a small edge — it is statistically indistinguishable from zero. And the in-sample segment, the very data the parameters were chosen on, is negative once the look-ahead and costs are fixed. A parameter set that cannot win on its own selection data, and ties zero on unseen data, was never a finding. It was a coincidence with a Sharpe ratio attached.

Failure 2: the sensitivity table has no plateau

A robust parameter choice sits on a plateau: nudge the parameters and the result wobbles but survives. A fragile one sits on a spike — or, as here, at the least-bad point of a losing neighbourhood.

The corrected run's sensitivity table (Sharpe, full corrected harness):

Fast/Slow Sharpe
3/10 -0.55
5/20 (chosen) -0.32
10/40 -0.67
5/50 -0.55
20/60 -0.38

Every neighbouring parameter set loses. The chosen 5/20 is not the peak of a profitable region; it is the shallowest point in a basin where all five tested sets are negative, spanning -0.32 to -0.67. After the look-ahead is removed, there is no parameter region on this data that rescues the strategy — which is exactly the information a sensitivity table exists to deliver before money is committed, not after.

This is the part of an audit people resist most, because it cannot be fixed by trying harder. Testing more parameter sets on the same sample does not create a plateau; it just searches the same noise more thoroughly and makes the winner look more deliberate than it is.

The order of operations that prevents both failures

  1. Split first, search second. Reserve the holdout before any parameter is tried. The moment a holdout number influences a choice, it stops being a holdout.
  2. Report both segments side by side. In-sample and holdout in the same table, every time. A single blended number hides exactly the gap this audit found.
  3. Demand a plateau, not a peak. Require neighbouring parameter sets to stay within a stated tolerance of the chosen result. All-negative neighbours mean the answer is "no edge here", whatever the headline number says.
  4. Treat a near-zero holdout as a verdict, not a teaser. +0.09 does not mean "promising, needs tuning". It means the selection data carried the result, and the honest next step is a different hypothesis — not a finer grid.

The audit, closed

Across the three parts, one backtest went from +140.37% / Sharpe 1.16 to -22.04% / Sharpe -0.32, with no holdout evidence and no parameter plateau underneath it. None of the three failures required exotic mathematics to find: a shift audit, a cost stack, a sample split, and a five-row sensitivity table. What they required was running the checks before believing the number — which is the whole job.

The demo strategy and data are synthetic and reproducible from the audit script; nothing here is a claim about any real market or instrument, and nothing in this post is investment advice.