Glossary

What is a hold-out test?

A hold-out test, or out-of-sample test, checks a strategy on data that was not used to build or tune it: you choose the settings on one part of the history and test them once on the part kept aside.

Also called: out-of-sample test

The part you tune on is the in-sample period; the part you lock away is the out-of-sample period. If the chosen setting collapses there, the tuning found the past, not a pattern. Once you change anything after looking at the held-out data, it has become in-sample data too.

One split gives one out-of-sample result, not a probability, and a setting with a real edge can also have a weak stretch. TradingView's Pine Script documentation describes the split as a widely used way to help reduce overfitting. Walk-forward analysis repeats it in rolling windows.

In practice

In our test of five free Pine Script strategies on BTC/USDT 4h, the Double Supertrend setting picked on the first 70% of the period made +1,198% there, then lost 12.9% on the last 30% – rank 227 of 240 settings.

Simulated results on historical market data. Past performance is not indicative of future results. Not investment advice.

Read more

Topic: Overfitting

Part of the guide: Overfitting and luck

Sources