Out-of-Sample Testing: Why In-Sample Results Look Better Than They Are
Out-of-sample testing means checking a trading strategy on price history it was never built on, because in-sample results, from the data used to build and tune it, almost always look better than the strategy really is. Only the out-of-sample result says how it may trade next.
The test only counts if that held-back data stayed untouched until the end. Once a developer looks at it, changes the strategy and looks again, it slowly turns into in-sample data, and the result proves much less than it seems.
A backtest (a test on past prices) is evidence of a hypothesis; proof only arrives with live capital. When we review a strategy, we look for at least 24 months of live trading, and we run it on an account with our own money.
A believable out-of-sample result is weaker than the in-sample one. If it is just as good or better, ask how many times the held-back data was looked at.
- What is out-of-sample testing in trading?
- What is the difference between in-sample and out-of-sample data?
- How do you split data into in-sample and out-of-sample periods?
- Why can an out-of-sample test be misleading?
- Should out-of-sample results be worse than in-sample?
- Out-of-sample testing questions traders ask
What is out-of-sample testing in trading?
Out-of-sample testing in trading means running a finished strategy, once, on a stretch of price history it was never built or tuned on. The developer sets that stretch aside before starting, builds the strategy on the rest, and only then checks how it does on the held-back part.
Traders shorten it to OOS. Any strategy shaped to fit the past will look good on that same past. The more rules and settings a developer tries, the better the backtest tends to look, and the less it says about next year.
That is backtest overfitting, and out-of-sample testing is the standard defence against it. It does not prove a strategy works; it is the minimum check before money goes in.
What is the difference between in-sample and out-of-sample data?
In-sample data is the price history a strategy is built and tuned on; out-of-sample data is history kept out of that process. A strategy almost always looks better in-sample, because it was shaped to fit that period, so the out-of-sample result is the one to judge it on.
Live trading is the third stage, where nobody can look at the answer in advance.
| In-sample | Out-of-sample | Live trading | |
|---|---|---|---|
| Used for | Building and tuning the rules | One final test of the finished rules | Real orders with real money |
| Seen by the developer | Many times | Once, if done properly | Only after it happens |
| Typical result | The best-looking numbers | Somewhat weaker | Weaker again, after trading costs |
| What can go wrong | Rules fitted to random ups and downs | The data was looked at during building | Too few trades to judge |
| What it proves | Almost nothing on its own | That the rules hold on new data | That the strategy works with money on it |
How do you split data into in-sample and out-of-sample periods?
Split price data by time, never at random: build the strategy on earlier years and test it on later ones, either as one held-back block at the end or as a walk-forward test that repeats this through the years. Walk-forward is the more thorough of the two.
A random split is the most common mistake. If the days are shuffled, the strategy is built on prices that come after the days it is tested on, so the future leaks into the build.
A September 2026 study by Jiayu Li measured the damage on pure noise, data with nothing to find (arXiv, 2026). Its score measures how well a signal’s predictions matched what happened next, and zero means no skill. With the days shuffled into random groups, a signal with no skill scored +0.32; with the groups kept in time order, it scored +0.004.
There are two common ways to split by time:
- One block at the end. The strategy is built on the earlier years and tested once on the last stretch. It is simple, but the result rests on a single period.
- Walk-forward testing. The strategy is built on one window and tested on the next, then the window moves forward and the process repeats.
Either way, each held-back period should include markets the building period did not, such as a sharp sell-off, and enough trades to mean something. A dozen trades tell you very little.
Why can an out-of-sample test be misleading?
An out-of-sample test can be misleading for two reasons: the held-back data was looked at during development, or so many versions were tested that one passed by luck. Every look that leads to a change, such as a new filter, turns held-back data into in-sample data.
A developer who spent three years on a strategy remembers how markets behaved in those years, and even with a holdout period fixed on day one, that memory shapes which signals to keep and when to stop refining.
Testing many versions is the second problem, because only the winner gets shown. Bailey and López de Prado built the deflated Sharpe ratio (2014) to correct a result for the number of versions tried. The Sharpe ratio measures return per unit of risk; the deflated version marks it down more as more versions are tested.
- In a July 2026 study of about 200 published stock-trading strategies, the median monthly return fell from 0.48% in data up to 2005 to 0.19% after it, and to 0.07% among larger companies
- A 2025 test found that AI forecasts score best on dates whose outcome was already in the model’s training text, and that advantage disappears after the training cutoff
- In 2016, a Quantopian study of 888 trading algorithms found the backtest Sharpe ratio explained less than 2.5% of the variation in their out-of-sample Sharpe ratio
Should out-of-sample results be worse than in-sample?
Yes, out-of-sample results should be somewhat worse than in-sample results while behaving the same way: similar trades, similar losing streaks, a smaller profit. A result that matches or beats the in-sample period deserves questions, because a strategy rarely does better on data that was not used to build it.
In a made-up example, a Sharpe ratio of 2.4 in-sample and 1.7 out-of-sample is a believable story: the strategy found something real and lost some shine on new data. A Sharpe ratio of 2.4 in-sample and 2.6 out-of-sample most often means the held-back data was used along the way.
We ask a manager for three things:
- The in-sample and out-of-sample results side by side, for each walk-forward window if there are several
- The number of versions tested before the final run
- The date the out-of-sample period was fixed, compared with the date the rules were last changed
An out-of-sample result is still a simulation, and US regulators treat it as one. On 11 September 2023 the SEC fined nine investment advisers a combined $850,000 for putting hypothetical results, such as backtests, on their websites without the safeguards the rules require, and it charged five more in April 2024. Always ask whether a result is simulated or live.
- The gold strategy in the Algotrader.ch Review has traded live since June 2024, and a fourth live account started in October 2026. Each new account is a fresh test, and we check that its results stay in line with the others
- Before a strategy appears in the Algotrader.ch Review, we test it with our own money
- In October 2026, a gold strategy provider backed off as soon as we said a risk assessment was a must-have
We recommend readers to treat a good out-of-sample result as a reason to keep looking, and to wait for at least 24 months of live results before treating a strategy as proven.
Out-of-sample testing questions traders ask
OOS in trading stands for out-of-sample: the part of the price history a strategy was not built on, kept back to test it. OOS results in a strategy report come from that held-back period, and they carry weight only if the period stayed untouched during development.
Walk-forward testing is one way of doing out-of-sample testing, and usually the stronger one. A simple split holds back one block of data at the end; walk-forward holds back many blocks in turn, so the strategy is tested on several different periods instead of one.
Yes, for a trading strategy out-of-sample testing should always be out-of-time testing: the test data must come later than the data used to build it. In other fields out-of-sample can mean a random selection, but with prices that lets the future leak into the build.
A strategy should trade live for at least 24 months before you trust the result, and longer if it trades rarely. The number of trades decides how much a record proves: hundreds of trades a month build evidence quickly, a few dozen a year take years.
Submit your algo or quant strategy to the Algotrader.ch Review
Send us your strategy with its out-of-sample evidence: the in-sample and out-of-sample results side by side, the date the test period was fixed, the date the rules were last changed, and the number of versions tried.
We then look for at least 24 months of live trading and run the strategy on an account with our own money. Only the few strategies that pass our review are featured, and nobody pays us for a place in the Algotrader.ch Review. Our scoring methodology lists everything we check.
Submit your strategy →