# The overfitting trap

> Why a great backtest can be a lie.

Source: https://www.texttoquant.com/academy/overfitting-trap
Level: Beginner · 5 min · lesson 5 of 12

---

It's easy to find parameters that looked perfect in the past. The hard part is knowing whether you found a real edge or just fit the noise. This is the most important lesson in the Academy.

## The past is easy to fit

Any market has thousands of coincidences. Search hard enough and you'll find an RSI level and a timeframe that would have printed money on that exact history. That doesn't mean it will repeat; it means you found a pattern in the noise.

## The sweep exposes it

Run this, then open Robustness and Parameter sensitivity (on Power and above). Sweep the RSI levels and watch the Deflated Sharpe on the board fall away from the raw Sharpe: it discounts your result by how many settings you tried. A big gap between the two is the tell that the edge was mostly search luck. The overfit probability needs a grid of settings, so run a Joint sweep when you want that number as well.

## Try it

```
Buy ETH when RSI drops below 30, sell when RSI rises above 70, on the 4 hour chart, last 3 years.
```

Run it: https://www.texttoquant.com/terminal?q=Buy%20ETH%20when%20RSI%20drops%20below%2030%2C%20sell%20when%20RSI%20rises%20above%2070%2C%20on%20the%204%20hour%20chart%2C%20last%203%20years.&parse=1

**Takeaway:** Never trust a single backtest. A robust edge survives the sweep; an overfit one collapses under the Deflated Sharpe.

## Check yourself

An RSI level printed money over the last three years. What does that prove?

1. The edge is real, because the price data is real
2. It will repeat as long as the market stays similar
3. Nothing yet. Until a sweep shows nearby settings also work, it may be a pattern in the noise

Answer: 3. Any history has thousands of coincidences. A robust edge survives the sweep; an overfit one collapses under the Deflated Sharpe.

Terms used: [overfitting](https://www.texttoquant.com/academy/glossary#overfitting), [deflated-sharpe](https://www.texttoquant.com/academy/glossary#deflated-sharpe), [sharpe-ratio](https://www.texttoquant.com/academy/glossary#sharpe-ratio)
