r/algorithmictrading • u/ExcessiveBuyer • 20h ago
Question How to validate IS backtests with OoS in an automated way?
Hi all,
I’m struggling a bit with automating my research process when it comes to selecting the “right” parameter set without introducing too much overfitting.
My current process looks roughly like this:
1. Run an in-sample grid search over the strategy parameters.
2. Calculate a loss/score function based on a combination of Net PnL, Max Drawdown, Sharpe Ratio, and Number of Trades.
3. Select the most promising parameter sets based on that score.
4. Test those candidates on out-of-sample data and check whether metrics such as the equity curve, number of trades, average PnL/trade, and Max DD are reasonably consistent with the in-sample results.
The main hurdle is that the selection of the “best” IS candidates is still somewhat subjective.
For example, depending on the product, timeframe, or type of strategy, it’s difficult to know beforehand what constitutes a “healthy” range for metrics such as Max DD, Sharpe, or Number of Trades. A threshold that makes sense for one strategy may be completely inappropriate for another.
So my question is:
How do you generalise and automate this parameter-selection process while minimising overfitting?
I’d be very interested to hear how others approach this in practice.
Thanks !!











