RSI-Adaptive, GKYZ-Filtered DEMA
Sep 21, 2022

The RSI-Adaptive, GKYZ-Filtered DEMA indicator is a specialized trend-following tool that combines an RSI-driven Double Exponential Moving Average (DEMA) with Garman-Klass-Yang-Zhang (GKYZ) historical volatility filtering to provide smoother, noise-resistant price action signals.
Usage
The indicator can be used to identify trend direction and potential reversal points. When the adaptive DEMA line changes color (typically green for bullish and red for bearish), it indicates a shift in market momentum. Traders can use the integrated "L" (Long) and "S" (Short) signals to pinpoint entries.
The GKYZ filter acts as a threshold: if the price or the indicator value hasn't moved beyond a volatility-based deviation, the output remains flat. This is particularly useful for avoiding "whipsaws" during low-volatility or sideways market conditions.
Details
This script employs a multi-step calculation process:
- RSI-Alpha Generation: The Relative Strength Index (RSI) is transformed into an alpha (smoothing) value. This makes the DEMA "adaptive," meaning it reacts faster during strong trending moves (where RSI is extreme) and slows down during consolidation.
- DEMA Calculation: The alpha is injected into a Double Exponential Moving Average formula to reduce lag compared to a standard EMA.
- GKYZ Filtering: The Garman-Klass-Yang-Zhang estimator is an extension of historical volatility that accounts for opening jumps and intraday price range (OHLC). It is considered more efficient than classic close-to-close estimators. This volatility is used to filter out price noise by requiring price changes to exceed a certain standard deviation of the GKYZ value before updating.
Settings
Source Settings
- Heikin-Ashi Better Calculation Type: Selects the smoothing method (AMA, T3, or Kaufman) for HA-based sources.
- Source: Choose from a wide variety of price inputs, including standard OHLC, Median, and expanded Heikin-Ashi variants.
Basic Settings
- Period: The lookback period for the primary DEMA calculation.
- RSI Period: The lookback period used to determine the adaptive alpha value.
- T3 Hot: Adjusts the volume factor if T3 smoothing is selected in source settings.
Filter Settings
- Filter Options: Determines whether the GKYZ filter is applied to the Price, the DEMA output, both, or neither.
- Filter Deviations: Sets the volatility threshold; higher values result in a "steppier," more filtered line.
- Filter Period: The lookback period for the GKYZ historical volatility calculation.
UI Options
- Color bars?: Toggles bar coloring based on the current trend.
- Show Signals?: Toggles the visibility of Long and Short labels.
FAQ
How do I interpret the GKYZ filter?
The filter prevents the indicator from updating unless the change in price (or value) is significant relative to the current market volatility. If the line is flat, the market is currently in a state of noise or low volatility relative to your "Filter Deviations" setting.
What makes this DEMA "adaptive"?
Unlike a standard DEMA with a fixed length, this version uses the RSI to constantly change its smoothing factor. This allows the indicator to track price closely when momentum is high and smooth out when momentum is neutral.
How do I get access to RSI-Adaptive, GKYZ-Filtered DEMA?
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.