You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Meta-Labeling the Classics (Part 2): Filtering and Sizing ADX Trades.
The DI crossover often triggers in ranges where +DI and -DI oscillate without persistence. We build a two-layer hybrid: Optuna's TPE optimizes a regime gate over ADXR threshold, DI lookback, and minimum DI separation to maximize signal precision on a held-out window, then a Random Forest uses eleven ADX-derived features to accept or scale entries via afml.bet_sizing. The result filters ranging-market bursts and calibrates position size on EURUSD H1.
The DI crossover fires a directional signal whenever +DI14 crosses above -DI14 or the reverse. It does not ask whether the market at that moment has sufficient directional persistence for a trend-following bet to recover transaction costs before price reverts. In a trending environment, the crossover is often decisive: the dominant DI climbs steadily, the separation widens, and the position runs in the intended direction. In a ranging environment, the two DI lines oscillate around each other, generating repeated crossovers within the same compressed price band. Each crossing looks structurally identical to the ones that produced clean trending moves. The entry logic has no way to distinguish the two.
Welles Wilder recognized this and embedded a partial remedy directly into the system. The Average Directional Movement Index Rating (ADXR) — the p-period average of ADX — serves as his regime filter: use trend-following only when ADXR exceeds 25, and avoid it when ADXR falls below 20. More precisely, ADXR is (ADX today + ADX n periods ago)/2. The formula given in Section 2 is correct, but the verbal definition here is a simplification. This rule is a necessary condition, not a sufficient one. Two crossovers with identical ADXR readings can have very different outcomes depending on whether ADX is rising or falling, how wide the DI separation is at the moment of the cross, how long the dominant DI has been dominant, and what the bar-level volatility context looks like. A scalar threshold cannot capture this combinatorial structure.
This article implements a two-layer response to that limitation. The first layer replaces Wilder's fixed ADXR threshold with a data-driven gate. Using Optuna, Bayesian hyperparameter optimization searches three parameters—ADXR threshold, DI lookback period, and minimum DI separation—to maximize signal precision on a held-out validation period. The second layer applies a Random Forest secondary classifier to each signal that passes the gate, using eleven ADX-derived contextual features computed at the signal bar. Position size scales with classifier confidence via the afml.bet_sizing module, following the same bet-sizing architecture introduced in Blueprint Part 10.
Author: Patrick Murimi Njoroge