Skip to content
All library documents

Adaptive Cycle Period, MAMA and Regime Switching with Ehlers Filters

Article MQL5 articles

Summary

This article presents a reproducible DSP pipeline for adapting trading signals to changing market rhythms. A Hilbert-transform homodyne discriminator estimates the dominant cycle period from in-phase and quadrature components, then clamps and smooths the estimate. The period drives MAMA and its follower FAMA. An Expert Advisor uses the Even Better Sinewave to distinguish cycle and trend regimes, fading the oscillator in cycle mode and following MAMA/FAMA in trend mode. The implementation emphasizes closed-bar decisions, replaying filter state from history, and shared modules with explicit accessors.

The author reports that the modules were compiled and tested in MetaTrader’s Strategy Tester using real ticks on EURUSD M30. The run is presented as a demonstration that the regime logic behaves as intended, not as proof of a durable edge or a finished system. The article recommends validation across instruments and timeframes, plus walk-forward and out-of-sample analysis. The filters and strategy rules are engineering examples whose results may not generalize.

Key ideas

  • The homodyne discriminator estimates dominant cycle length from the phase change between in-phase and quadrature components.
  • Clamping and smoothing constrain noisy period estimates before they feed adaptive averages.
  • MAMA and FAMA use the estimated phase to adjust their response to changing market rhythms.
  • The Expert Advisor selects cycle or trend rules using the Even Better Sinewave indicator.
  • The reported EURUSD test demonstrates implementation behavior, not profitability or generalization.

Tags

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