Discussing the article: "The Brunner-Munzel Test for MQL5: Comparing Trade Outcomes When the Variances Don't Agree"

Check out the new article: The Brunner-Munzel Test for MQL5: Comparing Trade Outcomes When the Variances Don't Agree.

Mann–Whitney's usual normal-approximation reading relies on equal shape and variance, which trade outcomes often violate. We implement the Brunner–Munzel test natively in MQL5, validate it against SciPy, and quantify Mann–Whitney's type‑I mis-sizing under unequal variance. The test is integrated as a one‑sided regime gate inside a Donchian breakout EA with rolling logs, giving you a variance‑robust filter for live comparisons.

Comparing trade outcomes between two volatility regimes — a high-ATR percentile and a low one — with the standard Mann-Whitney U test runs into a real problem: its normal approximation assumes both groups share the same variance, and a volatility-gated system's two regimes almost never do. Brunner and Munzel's 2000 generalized Wilcoxon test asks the same stochastic-comparison question without that assumption, using a Welch-Satterthwaite-style correction built from each sample's own placement variance. This article implements it from scratch in native MQL5, with no external libraries, and uses it as a live one-sided filter inside a Donchian breakout Expert Advisor, blocking a regime when it tests as stochastically worse than the other.

Bottom line, across a twelve-run Strategy Tester matrix (three symbols, two timeframes, gate on and off): the filter only fired on one of six symbol/timeframe configurations, and even there it did not demonstrate a proven improvement in profitability — exposure changed along with the block, so the two effects aren't cleanly separable. What follows is the test's math, its MQL5 implementation, the EA built around it, and exactly what that one case does and doesn't show.

Author: Adewumi Babatunde Gbadebo