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.
Related terms
Read more
- 5 Free Pine Script Strategies, 6.5 Years of Bitcoin, Tested
- How to Backtest a Trading Strategy Properly: 10 Rules
- Pine Script Parameter Optimization: A Grid-Search Guide
- How we judge results: the hold-out check
Topic: Overfitting
Part of the guide: Overfitting and luck