Skip to content
All library documents

Avoiding Overfitting by Choosing Stable Trading Parameter Regions

Article MQL5 articles

Summary

The article explains parameter optimization as part of iterative strategy development and warns that selecting settings solely for peak historical profit can overfit past data. It recommends looking for broad regions where performance remains relatively stable when parameter values change slightly, rather than choosing a sharp isolated maximum. An example evaluates RSI and Stochastic periods alongside StopLoss settings for a momentum-based overbought and oversold Expert Advisor, then combines promising regions across optimization graphs to select parameters.

The guidance is to use a representative sample, evaluate chosen settings outside the optimization data, limit the number of parameters optimized at once, and begin with wider search steps before examining promising clusters more closely. The article gives a three-year minimum for daily data as its rule of thumb, but does not provide detailed out-of-sample results or establish that its example settings generalize. Its advice is a practical heuristic for reducing curve fitting, not a guarantee of future profitability.

Key ideas

  • Parameter optimization can overfit historical data when settings are selected only for maximum past profit.
  • Prefer broad, stable performance regions where small parameter changes do not cause large profit swings.
  • The example optimizes RSI and Stochastic periods and StopLoss for an overbought and oversold momentum system.
  • Use representative data and evaluate the selected parameters on data outside the optimization sample.
  • Limit simultaneous parameters and use wider initial search steps to reduce fitting risk and search effort.

Tags

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