STD-Filtered, N-Pole Gaussian Filter
Sep 4, 2022

The STD-Filtered, N-Pole Gaussian Filter indicator provides a generalized smoothing tool that allows for arbitrary pole orders to reduce noise while maintaining lower lag than standard moving averages. It integrates a standard deviation-based filter to further isolate significant price movements from market volatility.
Usage
The Usage section describes how the script can be used to identify trends and filter market noise. Users can apply this indicator to identify trend direction based on the color-coded output (green for bullish, red for bearish) and look for crossovers between the current filter value and its previous state as potential signal points.
The primary settings influencing the indicator's behavior include the Order (number of poles) and the Filter Options. Increasing the pole order provides sharper high-frequency rejection, while the Standard Deviation filter allows users to "freeze" the indicator value if price changes are within a certain volatility threshold. This is particularly useful in sideways markets to prevent whipsaws.
Details
This tool is based on the Gaussian Filter concepts introduced by John F. Ehlers in "Rocket Science For Traders." While traditional Gaussian filters often cap at 4 poles, this implementation generalizes the formula to support "N-Poles" (practically up to 15 poles for precision).
A Gaussian filter functions as a low-pass filter with a transfer response resembling a bell curve. Compared to a Butterworth filter of the same order, a Gaussian filter provides approximately half the lag, calculated as: $Lag = \frac{N \times P}{\pi^2}$ Where $N$ is the number of poles and $P$ is the critical period.
The integrated Standard Deviation filter works by calculating a threshold based on the Filter Deviations and Filter Period. If the absolute change in price (or the filter output) is less than this threshold, the value remains unchanged, effectively smoothing out minor fluctuations.
Settings
Source Settings
- Heiken-Ashi Better Smoothing: Selects the smoothing method (AMA, T3, or Kaufman) for specific Heiken-Ashi source types.
- Source: Choose from a wide variety of price inputs, including standard prices, Heiken-Ashi variants, and smoothed bodies.
Basic Settings
- Period: Sets the lookback period for the Gaussian calculation.
- Order: Determines the number of poles used. Higher orders result in more aggressive smoothing of high frequencies.
Filter Settings
- Filter Options: Determines where the standard deviation filter is applied (Price, Gaussian Filter, Both, or None).
- Filter Deviations: The multiplier for the standard deviation threshold.
- Filter Period: The lookback period used to calculate the standard deviation for the noise filter.
UI Options
- Color bars?: Toggles price bar coloring based on trend direction.
- Show signals?: Toggles visual "L" (Long) and "S" (Short) shapes on the chart.
Moving Average Inputs
- Fast/Slow Ends: Specific parameters for Kaufman’s Adaptive MA (KAMA) and Adaptive Moving Average (AMA) used in source smoothing.
FAQ
How do I interpret the signals provided by this tool? The indicator displays green for uptrends and red for downtrends. "L" and "S" signals appear when the filter crosses its own previous value, provided the standard deviation filter requirements are met.
What is the benefit of using more than 4 poles? Higher pole counts provide a steeper roll-off, meaning they are more effective at removing rapid price oscillations (noise) while maintaining a smoother curve compared to low-order EMAs.
How can I get access to 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.