Discussing the article: "MetaTrader 5 Machine Learning Blueprint (Part 19): Bagging Regimes"

 

Check out the new article: MetaTrader 5 Machine Learning Blueprint (Part 19): Bagging Regimes.

We test AFML's claim that the sequential bootstrap decorrelates bagged trees on overlapping triple‑barrier labels by isolating two levers: draw count and draw rule. One decision identical tree is bagged under four row‑sampling regimes and evaluated on EURUSD 2022–2023 for draw uniqueness, between‑tree correlation, AUC, and calibration. Decorrelation comes almost entirely from throttling max_samples to average uniqueness; the sequential draw adds little. Out-of-bag inflation is largest under full-count sequential sampling.

The variance of a bagged ensemble of N base learners, each with variance σ² and average pairwise correlation ρ, is the AFML §6.2 expression ρσ² + (1−ρ)σ²/N. As N grows the second term vanishes, but the first does not. It is floored by ρσ². Bagging reduces variance only to the extent that the base learners are decorrelated, and no number of trees rescues an ensemble whose ρ is stuck high.

Overlapping triple-barrier labels push ρ up. An event opened at bar t may not resolve until bar t + 20, so a run of consecutive events shares most of its outcome window. A standard bootstrap draws with replacement from these near-duplicate rows, so two trees see substantially the same information and agree more than independent trees would. Average uniqueness, from AFML §4.4, quantifies the redundancy: it is the mean over each event's lifespan of one divided by the number of concurrent events. On the EURUSD tick bars used here it is 0.435, meaning the effective independent sample is well under half the nominal row count.

AFML §4.5 offers the sequential bootstrap as the remedy. Rather than drawing uniformly, it draws each successive index with a probability that falls as its overlap with the already-drawn set rises, so the sampled set is steered toward low concurrency. The claim under test is specific: that this draw rule, and not merely the reduced draw count that usually accompanies it, is what lowers ρ.

Author: Patrick Murimi Njoroge