Kalman Filtered RSI Oscillator
Mar 17, 2024

The Kalman Filtered RSI Oscillator indicator is a momentum analysis tool that integrates a Kalman filter with the Relative Strength Index (RSI) to provide a noise-filtered representation of market trends. By applying empirical prediction techniques to the RSI calculation, it aims to deliver more responsive signals for trend detection and momentum shifts compared to traditional oscillators.
Usage
The indicator can be used to identify trend direction and momentum strength through its color-coded histogram and midline crossovers.
- Trend Identification: When the oscillator is above the 0 midline, it suggests a bullish trend. When below, it suggests a bearish trend.
- Momentum Strength: The histogram colors provide visual cues regarding momentum:
- Bright Green: RSI is above 0 and rising (strong bullish momentum).
- Dull Green: RSI is above 0 but falling (weakening bullish momentum).
- Bright Red: RSI is below 0 and falling (strong bearish momentum).
- Dull Red: RSI is below 0 but rising (weakening bearish momentum).
- Smoothing: Users can enable additional smoothing via various moving average types (HMA, EMA, SMA, etc.) to further refine signal clarity in volatile markets.
Details
The script operates by first passing the selected price source through a Kalman filter. The Kalman filter is a mathematical algorithm that provides an efficient recursive means to estimate the state of a process in a way that minimizes the mean of the squared error. This filtered price is then used as the input for a standard RSI calculation.
To improve visual interpretation, the resulting RSI is normalized and centered around a zero midline. This allows the oscillator to act as a more balanced trend-following tool. The inclusion of a "Filter Order" allows the recursive calculation to be repeated, potentially increasing the smoothing effect at the cost of slight lag.
Settings
Calculation
- Kalman Price Source: Determines the input data used for the Kalman filter (e.g., Close, HL2).
- Process Noise: Adjusts the internal prediction uncertainty of the Kalman filter; lower values result in more smoothing.
- Measurement Noise: Adjusts the sensitivity to price changes; higher values result in more smoothing.
- Filter Order: Sets the number of iterations for the filter algorithm.
- RSI Calculation Period: The lookback period used for the underlying RSI calculation.
Smoothing
- Smooth RSI?: Toggle to apply an additional moving average to the output.
- Smoothing Type: Select from various moving averages (HMA, THMA, EHMA, SMA, EMA, WMA, TEMA, VWMA).
- Smoothing Period: The lookback length for the secondary smoothing average.
UI Settings
- Show Kalman RSI?: Toggles the visibility of the histogram columns.
- Paint candles according to Trend?: When enabled, it colors the chart candles based on the current RSI trend relative to the midline.
FAQ
How do I use the Kalman Filtered RSI Oscillator?
You can use it to identify trend direction via the 0-line crossover and evaluate momentum strength by observing the histogram's color intensity.
What makes the Kalman Filter better than a standard EMA?
Unlike a standard EMA which uses a fixed multiplier, the Kalman filter dynamically updates its estimates based on incoming noise and price data, allowing it to be potentially more responsive to actual market shifts while filtering out minor fluctuations.
How can I access this script?
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.