STD- and Clutter-Filtered, Non-Lag Moving Average
Sep 14, 2022

The STD- and Clutter-Filtered, Non-Lag Moving Average indicator provides a high-precision weighted moving average designed to minimize lag while filtering out price noise and market chop. It utilizes a damping cosine wave for its weight coefficients to achieve a responsive, non-lagging output suitable for trend identification.
Usage
The Usage section describes how the script can be used, particularly in volatile markets where price noise often triggers false signals. The indicator applies two distinct filtering layers: a Standard Deviation (STD) filter to create a stepped price movement and a Clutter filter to identify "dead zones" or sideways chop.
- Trend Identification: Users can observe the line color to determine trend direction. Green indicates a bullish trend exceeding the clutter threshold, red indicates a bearish trend, and gray (optional) highlights chop zones.
- Noise Reduction: By adjusting the Filter Deviations, the moving average adopts a more "stepped" appearance, ignoring minor fluctuations that do not exceed the volatility-based threshold.
- Signal Generation: The indicator includes built-in signals (L/S) that trigger when the trend direction shifts after clearing the clutter filter threshold.
Details
The script employs a Finite Impulse Response (FIR) filter structure. Unlike IIR filters, this FIR construction ensures the response to price input settles to zero in finite time, preventing permanent distortion from historical outliers.
The core moving average uses a damping cosine wave as a line of weight coefficients. To further reduce lag, it utilizes a dual-element lag reducer based on a generic Kalman velocity component. The Clutter Filter acts as a secondary gate; it compares the slope of the moving average against a user-defined threshold. If the slope does not exceed this threshold, the movement is classified as "clutter" or "noise," and the trend state remains neutral or gray.
Settings
Source Settings
- Smoothing Type: Selects the method for Heiken-Ashi smoothing (AMA, T3, or Kaufman).
- Source: Provides extensive options including standard price inputs, Heiken-Ashi variants, and "Better" Heiken-Ashi smoothing.
Basic Settings
- Period: The lookback period for the non-lag moving average calculation.
- Clutter Filter Threshold: Sets the minimum slope requirement for a trend to be considered active. Higher values filter more chop.
Filter Settings
- Filter Options: Determines whether the STD filter is applied to the raw Price, the Moving Average, Both, or None.
- Filter Deviations: The multiplier for the Standard Deviation filter. Increasing this makes the output more stepped.
- Filter Period: The lookback period used specifically for the Standard Deviation calculation.
UI Options
- Color bars?: Toggles price bar recoloring based on trend state.
- Show signals?: Displays "L" and "S" shapes on trend reversals.
- Show dead zones?: If enabled, the indicator will display a neutral color when the clutter threshold is not met.
Moving Average Inputs
- Kaufman/AMA Constants: Specialized settings for fast and slow ends, applicable only when KAMA or AMA smoothing is selected in the Source settings.
FAQ
How does the Clutter Filter work? It measures the rate of change (slope) of the moving average. If the movement is too shallow to meet the threshold, the indicator treats the price action as noise rather than a trend.
What is the benefit of the STD Filter? The Standard Deviation filter helps in creating a "flat" line during periods of low volatility, only updating the value when price moves significantly beyond the established volatility range.
How do 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.