# Out of sample is the real test

> Holding data back to catch curve fitting.

Source: https://www.texttoquant.com/academy/out-of-sample
Level: Beginner · 5 min · lesson 6 of 12

---

If overfitting is the disease, out of sample testing is the diagnosis. The idea is simple: judge the strategy on data it was never allowed to see.

## Hold the last slice out

The trust strip under every result carries an OOS chip. The engine scores the last 30% of bars separately from the first 70% and grades whether the edge persisted late in the window. Nothing is fitted here, it is a plain split, but a strategy that only made money early in the window is exactly the kind of coincidence this catches. Hover the chip for the late slice's return and trade count.

## Walk forward is the strict version

For the toughest test, open Robustness and Walk forward optimization, on Power and above. It optimizes a parameter on an in sample window and scores the winner only on the unseen window that follows, then rolls forward and does it again. That is the closest a backtest gets to how you would actually run and retune the strategy live.

## Try it

```
Buy SOL when price crosses above the 50-day SMA, exit with a 10% trailing stop, on 1D, last 3 years.
```

Run it: https://www.texttoquant.com/terminal?q=Buy%20SOL%20when%20price%20crosses%20above%20the%2050-day%20SMA%2C%20exit%20with%20a%2010%25%20trailing%20stop%2C%20on%201D%2C%20last%203%20years.&parse=1

**Takeaway:** In sample performance is a hypothesis. Out of sample and walk forward are how you test it.

## Check yourself

What does the OOS chip under a result compare?

1. The last 30% of bars against the first 70%, with nothing fitted
2. The strategy against simply buying and holding
3. The same rules on two different assets

Answer: 1. It is a plain split of the window. If the edge only existed early, the late slice shows it. Walk forward is the strict, refitted version.

Terms used: [out-of-sample](https://www.texttoquant.com/academy/glossary#out-of-sample), [walk-forward](https://www.texttoquant.com/academy/glossary#walk-forward), [moving-average](https://www.texttoquant.com/academy/glossary#moving-average), [trailing-stop](https://www.texttoquant.com/academy/glossary#trailing-stop)
