In-Sample Data – The portion of historical data used to build and optimize a model or strategy. During backtesting, in-sample data (also called training data) is where you adjust rules and parameters for best results. Because the strategy is explicitly fitted to this data, there is a risk of overfitting: the robot may learn patterns that are idiosyncratic to the in-sample period.