Discussing the article: "Diebold-Mariano Test in MQL5: Does Your Indicator Actually Forecast Better Than a Random Walk?"

Check out the new article: Diebold-Mariano Test in MQL5: Does Your Indicator Actually Forecast Better Than a Random Walk?.

The article implements the Diebold–Mariano test in pure MQL5 with HAC long‑run variance and the Harvey–Leybourne–Newbold small-sample correction, and adds the Clark–West adjustment for nested models. Forecasts are scored without look‑ahead over a rolling window while accounting for overlapping horizons. An EA and indicator use these tests as a live gate so trades occur only when a model outperforms a random walk at the chosen right‑tail threshold.

Run two forecasters over a few hundred bars and one will have the lower RMSE. Should an EA trade it? Not until we ask whether the difference is larger than the noise—and decide what kind of evidence should open the gate.

This article builds a rolling forecast filter in plain MQL5. Three models predict the next three-bar return and are compared with a zero-return random walk. Forecasts enter the test only after their outcomes are known. The implementation accounts for overlapping forecast errors, short samples and the different question raised by a nested AR model.

The result is a test library, an Expert Advisor and a chart indicator, with CSV output for independent replay. Together, they help distinguish three claims that require different evidence: lower forecast error, predictive content and trading profit.

Author: Adewumi Babatunde Gbadebo