We implement Ehlers-style DSP filters in a single reusable MQL5 library and use it to build two indicators. The Roofing Filter applies a 2‑pole high‑pass followed by a Super Smoother to isolate the tradeable 10–48‑bar band. The Even Better Sinewave normalizes the wave to about ±1, oscillating in cycle regimes and railing in trends, so you can read cycles and detect regime shifts in charts and EAs.
Before he ever wrote a line of trading code, John F. Ehlers spent years as an engineer designing filters for radar and communications systems. When he turned to the markets, he brought that toolbox with him, and he made a claim most technical analysts never stop to examine: a price chart is a signal, in exactly the sense an electrical engineer means it. It carries information mixed with noise, it contains components at different frequencies, and it can be processed with the same mathematics that cleans up a radio transmission. Most indicators traders use every day—especially the simple moving average—are crude filters. An engineer would not accept them because they lag badly and let through the noise they are meant to remove.
This is the first article in a two-part series. It takes Ehlers' DSP approach seriously and implements it in MQL5. By the end of this part you will have a reusable filter library and two working indicators on your chart. By the end of the series you will have an Expert Advisor that identifies the current market regime and trades it accordingly. This is what Ehlers' framework is designed to support.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Check out the new article: Digital Signal Processing for Traders: Building Ehlers' Filter Library in MQL5.
We implement Ehlers-style DSP filters in a single reusable MQL5 library and use it to build two indicators. The Roofing Filter applies a 2‑pole high‑pass followed by a Super Smoother to isolate the tradeable 10–48‑bar band. The Even Better Sinewave normalizes the wave to about ±1, oscillating in cycle regimes and railing in trends, so you can read cycles and detect regime shifts in charts and EAs.
Before he ever wrote a line of trading code, John F. Ehlers spent years as an engineer designing filters for radar and communications systems. When he turned to the markets, he brought that toolbox with him, and he made a claim most technical analysts never stop to examine: a price chart is a signal, in exactly the sense an electrical engineer means it. It carries information mixed with noise, it contains components at different frequencies, and it can be processed with the same mathematics that cleans up a radio transmission. Most indicators traders use every day—especially the simple moving average—are crude filters. An engineer would not accept them because they lag badly and let through the noise they are meant to remove.
This is the first article in a two-part series. It takes Ehlers' DSP approach seriously and implements it in MQL5. By the end of this part you will have a reusable filter library and two working indicators on your chart. By the end of the series you will have an Expert Advisor that identifies the current market regime and trades it accordingly. This is what Ehlers' framework is designed to support.
Author: Adeolu Kayode Gbadebo