Ehlers Decycler Oscillator
A moving average removes noise by averaging it away, which is exactly what also creates its lag: the average cannot know a turn has happened until enough new bars have entered the window to outvote the old trend. Ehlers' Decycler takes the opposite approach. A single-pole highpass filter with a long cutoff isolates only the short-cycle content of price, and subtracting that highpass output from price itself leaves everything below the cutoff - the trend - with none of the lag a moving average would add, because nothing was averaged. A single Decycler line is a trend estimate, not a signal. This file builds two of them, at a fast and a slow cutoff, and plots the difference as a percentage of price. Because the fast Decycler tracks price more closely than the slow one, it turns first at a genuine change in trend direction, so the crossover through zero is the oscillator's turn signal - the same lead/lag relationship a fast/slow moving-average cross gives you, but built from a filter that does not carry the averaging lag of either underlying line. The two cutoff periods are genuinely independent of instrument or timeframe; the 30/60 default bar counts are Ehlers' own reasonable starting point, not a fitted constant. Notes and limitations - Both highpass stages are recursive (each bar depends on the bar before it), so the first few bars after either period is changed are a brief warm-up rather than a true reading; they are seeded at zero rather than left blank. - This is a filter-based trend estimate, not a cycle-length estimator - it does not measure or adapt to the market's dominant cycle the way this catalogue's Cycle Adaptive RSI does. The two cutoff periods are fixed inputs the trader sets, not something the indicator discovers. - Because it is a recursive filter rather than a lookahead smoother, it never repaints: every value shown for a closed bar is final. - A single highpass filter, no matter how carefully tuned, cannot fully separate trend from cycle on every instrument - very choppy, low-trend markets will still produce a noisy oscillator around zero rather than a clean signal.
Indicator · MT5 · v1.0 · Free
About Ehlers Decycler Oscillator
Ehlers Decycler Oscillator is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Fast period, Slow period and Alerts. MQL source code included.
Files in the download: EhlersDecyclerOscillator.ex5, EhlersDecyclerOscillator.mq5, EhlersDecyclerOscillator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Fast period | 30 | Fast highpass cutoff period in bars |
| Slow period | 60 | Slow highpass cutoff period in bars (must exceed fast) |
| Alerts | true | Alert once per closed bar on a zero-line cross |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Oscillator · Trend · Alerts · MT5 Indicator · MQL5 Source Code