Objective
You should be able to design a train/validation/holdout split for a time series, explain why the out-of-sample Sharpe ratio of a selected strategy is predictably lower than its in-sample value, quantify that drop under a simple model, and compute the luck benchmark for the best of trials.
Splitting a time series
Three roles, in time order:
- Training (in sample): fit parameters, explore, iterate freely.
- Validation: choose between the candidates the training stage produced. Choosing is fitting, so the validation score of the winner is also biased upward.
- Holdout (test): run once, on the single chosen specification, and report that number.
Splits are chronological, not random: random splits put tomorrow's data in the training set and leak autocorrelated information. A gap between blocks is needed when labels overlap (see Walk-Forward Validation). Alternatives to a time holdout are different assets (design on US equities, test on Europe) and live paper trading, the only holdout that cannot be peeked at.
Holdout discipline
A holdout is out of sample only until you react to it. Look, adjust, and look again, and it has become validation data. Rules that work in practice:
- Decide the success criterion before the first look.
- If the holdout result fails and you revise, the revised strategy needs new untouched data; the old holdout is now in sample.
- Count holdout looks in the research log like any other trial.
The holdout length is a trade-off. A Sharpe estimate from years has standard error about , so a 2-year holdout of a strategy with true Sharpe 1 has an expected t-statistic of and a one-sided 5% test detects it only about 41% of the time. A short holdout can catch a disaster but rarely confirms a modest edge, which is why the evidence from the mechanism and the trial count still matters.
Why the winner degrades out of sample
Let each candidate strategy have a true annualised Sharpe , and let the in-sample estimate be with , . Suppose true Sharpes across ideas are spread as . Then are jointly normal and
The out-of-sample estimate has fresh noise with mean zero, so its expectation is . Two consequences:
- The expected out-of-sample Sharpe is the in-sample Sharpe times a shrinkage factor . Selecting the in-sample winner does not change this factor, because the posterior depends only on the winner's own estimate; selection just guarantees that you are looking at a large , which is mostly noise.
- If no idea has an edge () the factor is zero: the winner's expected out-of-sample Sharpe is zero however impressive its in-sample number.
A ratio of out-of-sample to in-sample Sharpe well below one is therefore the normal outcome of selection, not a sign that "the market changed". It becomes a warning when it is far below what this calculation predicts.
The expected maximum Sharpe from many trials
If all trials have no edge and independent estimates with standard deviation , the best has expectation . Exact values of :
| 10 | 20 | 50 | 100 | 1000 | |
|---|---|---|---|---|---|
| 1.54 | 1.87 | 2.25 | 2.51 | 3.24 |
Bailey and López de Prado give a closed-form approximation, with the Euler–Mascheroni constant:
which gives , and for , within about of the exact values. The cruder overstates it (3.03 at ). In practice is estimated as the cross-sectional standard deviation of the trials' Sharpe ratios and is an effective number of independent trials, smaller than the raw count when variants are correlated.
Worked example
the in-sample winner, out of sample
You test 100 ideas, each on 5 years in sample and 5 years out of sample. True annualised Sharpe ratios across ideas are . (a) What is the expected in-sample Sharpe of the winner? (b) What is its expected out-of-sample Sharpe? Check by simulation.
Show solutionHide solution
Variances. and , so the in-sample estimates are with standard deviation .
(a) The winner is the maximum of 100 such draws: .
(b) The shrinkage factor is , so the expected out-of-sample Sharpe is . The idea may be genuinely good, but two thirds of its in-sample Sharpe was luck.
import random, statistics as st
random.seed(1)
TAU, YEARS, N, REPS = 0.3, 5, 100, 2000
se = 1 / YEARS ** 0.5 # s.e. of an annualised Sharpe estimate
best_is, best_oos = [], []
for _ in range(REPS):
true = [random.gauss(0, TAU) for _ in range(N)]
is_ = [t + random.gauss(0, se) for t in true]
oos = [t + random.gauss(0, se) for t in true]
k = max(range(N), key=is_.__getitem__) # pick the in-sample winner
best_is.append(is_[k])
best_oos.append(oos[k])
print(f"winner in sample: {st.mean(best_is):.2f}")
print(f"winner out of sample: {st.mean(best_oos):.2f}")
print(f"ratio: {st.mean(best_oos) / st.mean(best_is):.2f}")
This prints , and a ratio of , matching the calculation.
Worked example
is the best of 1000 backtests interesting?
An automated search runs 1000 signal variants on 3 years of daily data. The best has an annualised Sharpe ratio of 2.1. The cross-sectional standard deviation of the 1000 Sharpe ratios is 0.60. Is the winner interesting?
Show solutionHide solution
Benchmark from the trials themselves. Under the null that no variant has an edge, the best of 1000 is about .
Benchmark from theory. Three years of daily data give a standard error of , close to the observed dispersion of (the slightly larger spread allows a little true variation). This gives .
Verdict. The winner's 2.1 is only about to above the luck benchmark, well under half a standard error of . Its naive t-statistic of looks spectacular and means almost nothing here. Before spending holdout data on it, require a mechanism and look at whether neighbouring variants also work.
Knowledge check
True annualised Sharpe ratios across your ideas are spread as and each in-sample test uses 4 years of daily data. Your best idea shows an in-sample Sharpe of 1.4. What is its expected out-of-sample Sharpe?
Knowledge check
A strategy has a true annualised Sharpe ratio of 1. You reserve a 2-year daily holdout and require a one-sided 5% test to pass. Roughly how often does the holdout confirm the strategy?
Knowledge check
Your holdout result was poor, so you changed the stop-loss rule and reran on the same holdout, which now looks good. What is the status of that holdout?
Key takeaways
- Split chronologically into training, validation and a holdout used once on one specification.
- A holdout you react to becomes in sample; revisions need fresh data.
- Under a normal prior, expected out-of-sample Sharpe is in-sample Sharpe times ; with no real edges, it is zero.
- The best of null trials has expected Sharpe : about , , for 10, 100, 1000 trials.
- Short holdouts have little power; they guard against disasters rather than confirm small edges.
Practice problems
Finished reading?
Answer the 3 knowledge checks to complete this lesson (0 done).