Skip to content
All library documents

ARIMA Forecasting in MQL5: Inputs, Differencing, and Model Reuse

Article MQL5 articles

Summary

The article extends an MQL5 ARIMA class with easier prediction methods and model saving and loading. It explains why forecasts need enough input observations: autoregressive terms require lagged values, non-contiguous lags preserve intervening time positions, and differencing consumes observations and means predictions must be integrated back into the original data scale. For moving-average terms, the model has no future innovations available, so it initializes errors by running redundant predictions over known data before making the desired forecast.

The discussion also warns that multi-step forecasts become less informative as they extend beyond observed values. Once actual future errors are unavailable, moving-average contributions must be treated as zero, leaving forecasts governed by remaining autoregressive terms or the constant. Saved model files contain model orders, parameters, and a sum-of-squared-errors value, enabling use in an indicator or expert advisor. A simple forex application is presented as a demonstration, and the article explicitly says its direction-based example should not be used live. It offers implementation guidance, not evidence of predictive accuracy or profitability.

Key ideas

  • ARIMA predictions require inputs sufficient for the model's largest lags and differencing order.
  • Moving-average forecasts need initial error estimates derived from redundant predictions on known data.
  • Differenced forecasts must be reintegrated with input data to return to the original scale.
  • Far-ahead forecasts lose moving-average information when future innovations are unknown.
  • Models can be saved and loaded for use in MQL5 indicators and expert advisors.

Tags

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