Matana Labs

How to detect an overfitted trading strategy

An overfitted strategy has learned the noise of its history instead of a repeatable pattern, and it gives itself away in three ways: its best settings are a lone peak surrounded by much worse neighbours, its results drop sharply on data it wasn’t tuned on, and it has many rules or filters for the number of trades it makes. If you see all three, assume the backtest is mostly fitted noise.

Six tests

  1. Neighbours. Move each setting a little. A real effect gives a plateau; overfitting gives a spike.
  2. Unseen data. Compare the in-sample result with a held-back period or a walk-forward test.
  3. Number of tries. Count how many variants you tested and adjust for it (the deflated Sharpe ratio).
  4. Rules per trade. Every extra filter removes trades and adds a way to fit the past.
  5. Other markets and timeframes. A real idea usually works, more weakly, on similar symbols and nearby timeframes.
  6. Remove one rule at a time. If a rule barely changes the result, it isn’t doing anything; if one rule carries everything, ask why.

Worked example: tuning a moving average on a market with no trend

On one simulated price history with no trend at all, we tried 96 moving-average lengths for a simple “in when price is above its average” rule on the first two years, then traded the winner in the third year.

There was nothing to find in this market, yet tuning produced a convincing two-year result. Real data behaves similarly: in our walk-forward study, the in-sample winner of a daily-signal family stayed in its family’s top quarter in 30% of 24,072 folds, close to the 25% you would expect by chance.

What to do next

Updated 2026-11-24. Educational content, not financial advice. Backtests and simulations are not real trading, and past results don’t guarantee future ones. Risk disclaimer.

Related questions and tools

Test your own strategy in Matana Labs, from free All answers

Questions

Is every optimized strategy overfitted?

No. Tuning a few settings on a lot of data, choosing from a plateau and confirming on unseen data is reasonable. Overfitting comes from many settings, few trades and choosing the single best cell.

How much data should I hold back from optimization?

Enough to contain a meaningful number of trades on its own. Many people keep the most recent fifth to third of the history; the right share depends on how often the strategy trades.

Can a strategy be overfitted with only one parameter?

Yes, if you tried many values of it and picked the best, or if you also chose the symbol, period and timeframe by looking at results. Each of those choices is a try.