All indicators

Ehlers Undersampled Double Moving Average Indicator

Mar 23, 2023

Static chart image
SignalsMoving AveragesRepainting Functionality

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.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.