Ehlers Digital Filters for Separating Market Cycles from Noise
Summary
This article explains Ehlers’ signal-processing approach to price data and describes an MQL5 library for implementing several of his filters. It frames price as a mixture of fast noise, a middle-frequency cycle, and a slow trend. A low-pass filter can smooth noise, while combining a high-pass and low-pass filter isolates a band of cycle activity. The article contrasts these filters with simple moving averages, which it says can lag and leave unwanted frequency components in the output.
The library is designed to let indicators and a later Expert Advisor use the same recursive filter calculations. The article describes the Super Smoother, Roofing Filter, and Even Better Sinewave, including the latter’s use of oscillator railing as a possible sign that trend conditions dominate. It also discusses implementation concerns such as filter warm-up, state retention, and safeguards. The formulas are presented as implementations of published Ehlers work, with trigonometric units adapted for MQL5. No trading performance is reported; the follow-up article is expected to cover cycle measurement, adaptive averages, and strategy testing.
Key ideas
- Price can be viewed as a combination of noise, cyclical movement, and a slowly changing trend.
- A low-pass filter suppresses faster components, while a high-pass filter removes the slowest components.
- Combining high-pass and low-pass filters creates a band-pass effect for isolating cycle activity.
- Recursive filters must retain prior values and handle their warm-up period correctly.
- An oscillator that rails may indicate a shift from cyclical behavior toward trend conditions.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.