Skip to content
All library documents

A Modular MQL5 Framework for ARCH and GARCH Volatility Models

Article MQL5 articles

Summary

This article introduces an MQL5 library for specifying, fitting, forecasting, and assessing conditional volatility models. Its architecture separates the conditional mean, volatility process, and residual distribution, with a mean-model class serving as the interface for fitting and forecasts. A shared configuration structure holds the observations, exogenous variables, lag choices, model family, and estimation options. The article describes constant, AR, and HAR mean specifications alongside several ARCH and GARCH variants, plus distribution choices and forecast settings.

The library also provides model results and diagnostic tools, including an ARCH-LM test, and the article demonstrates that a HAR specification can be represented as an AR model with exogenous variables, reporting matching parameter output for the two approaches. The scope is an initial implementation: despite describing distribution options in its configuration, the conclusion says the current version assumes standard normal errors, with broader distribution support planned for later work. The article lays out software design and modeling workflow rather than providing evidence that a particular volatility model forecasts better or improves trading outcomes.

Key ideas

  • The library treats the mean process, conditional volatility, and residual distribution as separate model components.
  • A shared configuration structure specifies data, lags, model families, and estimation settings.
  • HAR and AR mean specifications can represent equivalent constructions in the demonstration.
  • Model fitting can be followed by diagnostics such as an ARCH-LM test.
  • The current implementation is described as limited to standard normal errors.

Tags

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