Skip to content
All library documents

Designing Training Windows for AI Stock Selection Models

Article MQL5 code base

Summary

This article examines how the length of a training window affects an AI stock selection model. It compares long historical samples with shorter rolling samples and recommends checking each choice against a held-out backtest period. In the author's experiments, expanding the long window changed predicted returns, Sharpe ratios, factor weights, and NDCG; performance peaked for one historical range before declining. The author also reports that short windows sometimes produced stronger returns but less reliable signals.

The discussion cautions that more training data is not automatically better: long windows can overfit, while short windows can underfit and produce brief, fragile excess returns. NDCG is considered alongside realized performance, though the author's suggested score thresholds are heuristics rather than universal standards. Market regime, model data, initialization, stock selection, and later risk or timing adjustments can all affect results. The examples are platform-specific backtests, with no independent validation or full experimental details, so the suggested windows should be treated as candidates to test rather than prescriptions.

Key ideas

  • Compare candidate training windows on a fixed out-of-sample period to see how model performance changes.
  • Longer histories can stabilize evaluation but may introduce overfitting and shifting factor importance.
  • Short training windows may yield attractive returns while increasing underfitting and signal decay risk.
  • Interpret NDCG together with realized returns and other diagnostics rather than as a standalone measure.
  • Training-window suitability depends on the model, its data, its initialization, and market conditions.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.