Ehlers Undersampled Double Moving Average Indicator
Mar 23, 2023

The Ehlers Undersampled Double Moving Average Indicator tool provides a sophisticated trend-following mechanism by applying smoothing filters to periodic price samples to reduce noise and identify market direction.
Usage
The Usage section describes how the script can be used to identify trend changes and momentum strength. Traders typically use this indicator to spot entries and exits based on the relationship between the fast and slow moving averages.
- Trend Identification: A bullish trend is indicated when the line turns green (Fast Average > Slow Average). A bearish trend is indicated when the line turns red (Fast Average < Slow Average).
- Momentum Strength: The indicator uses a four-color gradient system. Darker green or red colors represent "strong" signals where the distance between the averages is expanding (increasing momentum). Lighter shades represent "standard" signals where momentum may be slowing down.
- Sampling Frequency: By adjusting the Sample Length, users can control how often the indicator updates its internal price reference, allowing for a more "stepped" or "smooth" response to price action.
Details
The concept for this indicator was introduced by John Ehlers in the April 2023 issue of Stocks and Commodities. Unlike standard moving averages that process every bar, this script uses an "undersampling" technique, where price data is only updated every $N$ bars (defined by the Sample Length).
The sampled data is then processed through a Hann Windowed Moving Average (Hann Filter). This filtering method uses a cosine-based weighting coefficient to provide superior smoothing with minimal lag compared to traditional simple or exponential moving averages. The final output is a double moving average system where the crossover of a fast and slow period defines the primary trend signals.
Settings
- Source: Determines the price data used for calculations (e.g., HLCC4, Close, Open).
- Resolution: Allows the indicator to calculate based on a different timeframe than the current chart.
- Allow Repainting?: Toggles whether the indicator can use real-time data that may change before the bar closes.
- Allow Bar Color Change?: When enabled, this will change the color of the price bars to match the indicator's trend signals.
- Fast Length: The period for the faster Hann Filter; a smaller number makes the indicator more reactive.
- Slow Length: The period for the slower Hann Filter; used to establish the baseline trend.
- Sample Length: Sets the frequency of price sampling. For example, a value of 5 means the indicator only considers price data every 5 bars.
FAQ
How do I interpret the different colors on the chart? Dark green indicates a strong bullish trend with increasing momentum, while light green suggests a standard bullish trend. Dark red indicates a strong bearish trend with increasing momentum, and light red suggests a standard bearish trend.
What is the benefit of undersampling the price? Undersampling helps filter out minor price fluctuations and "market noise," focusing the indicator on more significant structural price movements as defined by the sample interval.
How can I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

