Building a Guarded Regime-Adaptive EA with a Decision-Forest Classifier
Summary
This article turns a prior decision-forest classification experiment into a modular MetaTrader Expert Advisor. The classifier assigns bearish, neutral, or bullish labels from completed-bar features; the author uses “regime” to mean a persistent directional state, not a broad description such as ranging or high volatility. A distinct decision layer checks confidence and state stability before the execution layer can authorize trades. The classifier itself cannot submit orders, and the EA is designed to act only on positions it owns.
The described pipeline trains on completed historical bars, stores feature normalization statistics for live predictions, and runs inference once a new bar begins. Confirmation and cooldown rules temper unstable predictions, while risk controls and server return-code checks sit at the execution boundary. Out-of-bag classification error is recorded as a diagnostic rather than an entry signal. The article provides an implementation architecture, not evidence of profitability; it explicitly calls for chronological out-of-sample testing and realistic transaction costs.
Key ideas
- The classifier labels directional moves, which the article distinguishes from broader market-structure regimes.
- Training and live inference use completed bars, and live features are normalized with statistics learned during training.
- Confidence, persistence checks, and cooldowns govern whether predictions can affect trading decisions.
- Separate model, decision, and execution layers constrain the classifier's authority.
- Out-of-bag error is diagnostic and does not replace chronological testing or cost-aware evaluation.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.