Discussing the article: "Meta-Labeling the Classics (Part 1): Filtering and Sizing RSI Trades"

 

Check out the new article: Meta-Labeling the Classics (Part 1): Filtering and Sizing RSI Trades.

RSI accumulates losses in trending conditions by firing at every threshold crossing regardless of market regime. A Random Forest secondary classifier trained on 12 contextual features — RSI momentum slope, EMA50 trend velocity, ATR-normalised trend stretch, and nine others — filters raw signals and scales position size by classifier confidence on EURUSD H1. Results compare plain RSI, meta-filtered RSI, and bet-sized RSI across a 16-month out-of-sample period with per-trade metrics and drawdown diagnostics.

RSI fires a signal every time its reading crosses a threshold. It does not ask whether the market condition at that moment is one in which a mean-reversion bet is likely to succeed. In a ranging market that question matters less, because the premise is broadly satisfied throughout. In a trending market — where each new extreme is structurally motivated rather than transient — firing at every crossover produces systematic, compounding losses regardless of how well the indicator is parameterized.

The meta-labeling framework from Chapter 3 of Marcos López de Prado's Advances in Financial Machine Learning addresses this directly. The primary model (here, the RSI strategy) continues to generate directional signals exactly as before. A secondary classifier receives each signal along with twenty-seven contextual measurements taken at the signal bar. It outputs the probability that the signal will succeed. Signals below a confidence threshold are skipped; position size on approved signals scales with classifier confidence. The primary model handles side prediction. The secondary model handles bet prediction.

This article implements the pipeline on seven years of EURUSD H1 data from MetaTrader 5. Section 2 quantifies the failure mode; Sections 3–5 define the framework, features, and validation; Sections 6–7 report results. The companion MQL5 article in this series implements the two-EA execution architecture that translates these Python outputs into a live trading system.

Author: Patrick Murimi Njoroge