From TradingView · · 1m 20s
In-Sample vs Out-of-Sample Testing for CME_MINI:NQ1
How to avoid backtest overfitting with proper in-sample and out-of-sample testing for CME_MINI:NQ1 futures.
In brief
How to avoid backtest overfitting with proper in-sample and out-of-sample testing for CME_MINI:NQ1 futures. Proper in-sample and out-of-sample testing prevents backtest overfitting by using time-based splits and walk-forward validation for CME_MINI:NQ1 futures strategies. Originally reported by TradingView.
Split by Time, Never at Random
In-sample testing uses earlier data to develop strategies while out-of-sample testing checks results on unseen future data.
Set Pass Criteria Before Testing
Define minimum trade counts and profit factors for both in-sample and out-of-sample periods before running tests.
Keep OOS Data Single-Use

Treat out-of-sample data as single-use to prevent overfitting by not adjusting parameters after initial testing.
Walk-Forward Testing Process
Repeat in-sample and out-of-sample splits through time to test the optimization process multiple times.
Real Data Example Results
The safest-looking strategy broke, the highest-return strategy had deeper drawdowns, and the risk-adjusted pick performed best in out-of-sample testing.
Key Takeaway for Trading
The gap between in-sample and out-of-sample results indicates whether backtests were noisy or meaningful for CME_MINI:NQ1 futures.
Walk-Forward Implementation Tips
Use date-range inputs in TradingView to keep periods apart and give indicators warm-up periods before counting trades.
Why This Matters for Traders
Proper testing prevents traders from fooling themselves by grading tests with the answer key in hand.
The essence
Proper in-sample and out-of-sample testing prevents backtest overfitting by using time-based splits and walk-forward validation for CME_MINI:NQ1 futures strategies.
Read the TL;DR — this story on one card.






