Skip to content
All library documents

Regime Routing with Trend and Range Modules and a Win-Rate Ledger

Article MQL5 code base

Summary

RegimeRouter combines ADX, a Hurst estimate, and lag-one return autocorrelation to classify each closed bar as TREND, RANGE, or NEUTRAL. The measures vote independently; a minimum vote threshold is required to select a regime, while missing measures or insufficient agreement leave the system inactive. The trend module trades breakouts aligned with fast and slow EMAs, and the range module fades price z-score extremes relative to a moving average. A trade ledger groups results by regime and reports win rates, Wilson lower bounds, breakeven rates, and profit factors. The author also proposes forced-module runs as an A/B comparison against automatic routing.

Backtests show mixed outcomes: EURUSD was profitable over the reported sample, while XAUUSD lost money. The trend results remain statistically inconclusive, and the range sample is very small. The document reports no out-of-sample validation and notes that testing used modeled rather than real ticks. It presents a framework for measurement, not evidence of a proven edge; the adaptive Hurst option also changes how regime votes are assigned.

Key ideas

  • The classifier combines directional strength, return persistence, and short-term autocorrelation votes.
  • Trend conditions route to aligned breakouts, range conditions to z-score fades, and neutral conditions to no trade.
  • The ledger attributes deals to the originating regime and compares lower confidence bounds with breakeven rates.
  • Reported results differ by symbol and do not establish that either module has a reliable edge.
  • Forced-regime runs are proposed to measure whether automatic routing adds value.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.