Discussing the article: "MetaTrader 5 Machine Learning Blueprint (Part 23): Feature Screening"

Check out the new article: MetaTrader 5 Machine Learning Blueprint (Part 23): Feature Screening.

Permutation tests that assume exchangeable observations miscalibrate feature screens for overlapping financial labels, yielding a tenfold false‑positive inflation on EURUSD. This article implements a calibrated three‑gate pipeline: ADF+KPSS for stationarity, uniform‑grid entropy with modal occupancy, and mutual information corrected via a joint permutation null and Westfall–Young max‑T. The ScreeningReport summarizes gate outcomes and effective test count so you can filter features reliably before fitting models.

Every article in this series up to Part 19 has assumed the feature matrix already exists. A candidate column shows up, gets fractionally differenced or z-scored, and enters the model. Nothing in that pipeline asks whether the column deserved to be there. The usual first step (correlation, or a quick model with an importance score) implicitly uses a null hypothesis that is wrong for financial data. The obvious fix is a permutation test: shuffle the target, recompute the statistic, and see how often the shuffled version beats the real one. That fix can also be wrong, and this article spends its second section measuring how wrong, on EURUSD data rather than on a textbook example.

The failure mode is specific. Ordinary shuffling of a target series assumes every observation is exchangeable with every other one. A twenty-bar forward return is not exchangeable with anything: bar t and bar t+1 share nineteen of their twenty return contributions. An independent permutation destroys that overlap, so the null describes a different and easier estimation problem than the one the feature faces. In the configuration measured below (a persistent synthetic feature against the real overlapping EURUSD target), naive shuffling rejected a true null in all 200 trials at a nominal 5% level. The same section shows that the size of the distortion depends on the feature's persistence, the label overlap, and the test statistic, so it is not a fixed property of shuffling.

This article implements afml.screening with three gates: stationarity, entropy, and mutual information. The gates are not three versions of one idea. Gate 1 runs two formal hypothesis tests (ADF and KPSS) per feature. Gate 2 is a descriptive filter with no null and no p-value. Gate 3 is the only gate that draws its reference distribution from the resampling layer of Section 2, and the only one that can select a feature. Every number below comes from the H1 EURUSD dataset used across this series (42,584 aligned bars, 2018 through 2024) screened against a real twenty-bar forward return. One of the nine candidate columns is synthetic, and it is disclosed as such where it appears.


Author: Patrick Murimi Njoroge