Discussing the article: "Diebold-Mariano Testing in MQL5: Validating Predictive Edge Across Instruments and Models"

Check out the new article: Diebold-Mariano Testing in MQL5: Validating Predictive Edge Across Instruments and Models.

The article shows how to compare two trading forecasters in MQL5 using the Diebold–Mariano test with HAC‑corrected variance and the Harvey–Leybourne–Newbold adjustment. It explains implementation details, including loss choices, horizon‑dependent lag windows, rolling computation, verdict handling, and a manifest‑driven configuration, plus a Student‑t implementation without external libraries. An EA and an indicator provide a live dashboard and significance bands for practical, defensible model selection.

Sooner or later you end up with two forecasters, and the question that follows is rarely asked with enough rigor: is the new one actually better, or does it just look better on the chart you happened to be staring at? Equity curves answer this poorly - two curves can cross a dozen times and still leave you guessing whether the separation is real skill or favorable noise. What's needed is a formal test on the two series of forecast errors that accounts for serial correlation and small-sample behavior before calling a difference significant.

That test exists. Diebold and Mariano built it in 1995 for comparing macroeconomic forecasters, and it travels well to trading: given two loss-differential series, it returns a statistic and a p-value saying whether the difference in accuracy is distinguishable from zero. This article implements it natively in MQL5, with Newey-West HAC variance correction and the Harvey-Leybourne-Newbold small-sample adjustment - the latter starts to matter once you're down to a few hundred bars. An EA and a subwindow indicator both run it live and show a rolling verdict.

Author: Olamide Daniel Adebayo