Fractional EMA Kalman Filter
May 10, 2026

The Fractional EMA Kalman Filter indicator provides a specialized state-estimation and smoothing framework that merges a Kalman filter with fractional-length EMA inputs to maintain structural awareness during ranging conditions while maximizing reactivity during trends.
Usage
The Usage section describes how the script can be used to interpret market trends and filter price noise. This tool is designed to help traders identify directional shifts by comparing two different adaptive estimates of price.
- Trend Identification: The indicator plots two lines—a "Base" Kalman filter and a "Fast" Kalman filter. When the Fast filter is above the Base filter (indicated by a green fill), a bullish regime is suggested. Conversely, when the Fast filter is below the Base filter (indicated by a red fill), a bearish regime is suggested.
- Ranging Markets: During sideways price action, the Kalman logic naturally suppresses movement, causing the lines to flatten. This helps traders avoid "whipsaw" signals common in traditional moving averages.
- Dual-Filter Analysis: Users can compare the Base and Fast lines to gauge momentum. A widening gap between the two suggests accelerating momentum, while a narrowing gap suggests a potential exhaustion or reversal.
Details
The script utilizes a single-state Kalman architecture designed around "Innovation"—the difference between a measurement and the current state estimate.
- Fractional EMA Input: Instead of using raw price, the filter uses a double sub-integer EMA (e.g., 0.5 period). This creates a high-resolution, oscillating measurement stream that amplifies structural transitions, making regime changes easier for the Kalman filter to detect.
- Dynamic Q/R Logic: Most Kalman filters use fixed noise parameters. The D7 model derives Process Noise (Q) and Measurement Noise (R) dynamically from normalized residual variance (the tracking error). If the filter's prediction error is high, it automatically increases its responsiveness to catch up with the new price trend.
- Adaptive Variance: The innovation is normalized by the Average True Range (ATR), ensuring that the filter's sensitivity remains consistent across different assets and timeframes without requiring manual recalibration for volatility.
Settings
EMA Settings
- Show EMA: Toggles the visibility of the underlying fractional EMA measurement.
- Source: The price data used for calculations (default is Close).
- EMA Length 1: The period for the first fractional EMA layer.
- EMA Length 2: The period for the second fractional EMA layer.
Kalman Settings
- R base / R fast: The lookback period for measuring uncertainty (Measurement Noise).
- q multiplier base / q multiplier fast: A multiplier for Process Noise; higher values increase the filter's responsiveness to price changes.
- R Gate Multiplier base / fast: Sets a sensitivity floor for the residual variance to prevent the filter from becoming overconfident during low-volatility periods.
FAQ
How do I interpret the colored fill between the lines? The fill highlights the relationship between the Fast and Base Kalman estimates. A green fill appears when the Fast filter is higher (bullish momentum), and a red fill appears when the Base filter is higher (bearish momentum).
Why does the filter flatten out during sideways markets? When price lacks a clear direction, the residual variance decreases. The Kalman logic reacts by reducing the "Gain," causing the filter to trust its previous state more than new, noisy price data, resulting in a flatter line.
How can I access this tool? 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.