- Backtesting
The Biggest Backtesting Mistake: Looking at Your Holdout Twice
Why a test period becomes unreliable the moment it influences strategy selection.
The seven warning signs that a backtest learned its sample instead of the market, and the test that exposes each one.
A trading strategy is overfit when it has learned the quirks of its historical sample instead of a repeatable market relationship. The clearest sign is a result that collapses on data it has never seen. The other six below can be tested before you risk money.
Overfitting rarely looks like a mistake. It looks like careful work: more data, more parameters, a clean equity curve and a sensible story after the fact. Each sign below says what it looks like and how to test for it.
What it looks like: a strong backtest, then losses on later data. One configuration in our search showed +63.2% in the development search; tested once on locked data, it lost 42% to 49%. How to test: keep a final period the search never touches, and evaluate on it once, at the end. Past, hypothetical research results.
What it looks like: a 14-period setting is excellent while 13 and 15 are poor. How to test: perturb each parameter slightly and rerun. A real relationship degrades gradually; an overfit one falls off a cliff.
What it looks like: the best of hundreds or thousands of variants. With enough attempts, some will look excellent by chance. How to test: record how many configurations were searched, and discount the winner for it, for example with the Deflated Sharpe Ratio.
What it looks like: remove the best three trades and the strategy no longer works. How to test: count the trades and look at how much of the profit the largest winners explain.
What it looks like: a rule that thrives on one coin in one bull run. How to test: run the unchanged rule on other liquid assets and other years, including the conditions it was supposed to survive.
What it looks like: a positive gross edge that disappears once fees, funding and slippage are included. How to test: apply realistic costs per trade, and add a margin, because live execution is usually worse than the model.
What it looks like: a story written to fit the curve, or a regime switch that was never itself tested out of sample. How to test: write the hypothesis and the success criteria before the test, and test any switching rule on unseen data, as its own strategy.
| Sign | Test |
|---|---|
| Collapses out of sample | Locked final holdout, evaluated once |
| Fragile parameters | Perturb each parameter and rerun |
| Best of many variants | Count the search; deflate the Sharpe |
| Few trades drive it | Remove the top winners; count trades |
| One asset or period | Unchanged rule on other assets and years |
| Barely clears costs | Realistic fees, funding, slippage, plus a margin |
| Story after the fact | Pre-registered hypothesis; test the switch itself |
Pre-commit the evaluation, test across time and assets, lock the final holdout, and compare against a simple benchmark such as buy-and-hold on the same pair and period. Prefer strategies whose logic survives a modest change to its inputs. Most importantly, let a failed test retire the idea. In Agon, every strategy goes through backtest, Monte Carlo, walk-forward and paper trading, and must pass walk-forward validation before real-money mode is unlocked.
No. The warning sign is not the number of parameters but how much the result depends on their exact values and on the specific sample. A model with many parameters that survives small changes to them and a locked holdout is not, on that evidence, overfit.
It reduces it, but repeatedly redesigning a strategy after looking at walk-forward results reintroduces it. Keep a final holdout and decide the success criteria in advance.
There is no fixed amount. The data should include the conditions the strategy must survive, such as a bear market and a range, and contain enough trades for the result not to depend on a few of them.
Research, not investment advice.