Discussing the article: "Beyond GARCH (Part IV): Partition Analysis in MQL5"

 

Check out the new article: Beyond GARCH (Part IV): Partition Analysis in MQL5.

In this article, we shift from Python research to native MQL5 engineering. We build the first module of the MMAR library: a shared constants header, an SVD-based OLS regression class, a Generalized Hurst Exponent estimator, and the partition analysis engine that computes the partition function, extracts tau(q), estimates H via zero-crossing interpolation, and scores multifractality through three diagnostic tests. Tested on 500,000 bars of EURUSD M10, the engine correctly classifies the data as multifractal in under four seconds. Part 4 of an eight-part series. Part 5 fits the tau(q) curve to four candidate distributions via the Legendre transform.

Before writing any analytical code, we need a shared vocabulary. The MMAR library is composed of several modules that build on each other, and they all reference the same set of enumerations, structures, and type definitions. We store these in a single header file, MMARConstants.mqh, which every other module includes.

The architecture follows a layered design. At the bottom sit the utility modules: an OLS regression class and a Hurst exponent estimator. Above them is the Partition Analysis engine, which uses both utilities to compute the scaling function and evaluate multifractality. In later articles, we will add the Spectrum Fitter (which consumes the tau(q) curve produced by Partition Analysis), the Simulation Engine (which uses the fitted distribution to generate synthetic paths), and the Monte Carlo forecaster (which orchestrates many simulations). At the top sits a facade class, CMMAR, that ties everything together with a simple Fit-and-Forecast interface. For now, we build from the bottom up.

Figure 1 shows this layered architecture:

Author: Muhammad Minhas Qamar