Adaptive Kalman Price Smoothing with Online Noise Estimation
Summary
The document explains a scalar Kalman filter for smoothing price series and contrasts its changing weight with the fixed weights of simple and exponential moving averages. It models price as a random-walk latent state observed with noise, then updates the estimate each bar using a Kalman Gain derived from prediction uncertainty and measurement uncertainty.
To adapt the filter to financial data, it estimates process noise from rolling price-return variance and measurement noise from rolling price variance, with positive floors to avoid numerical degeneracy. The article describes a native MQL5 indicator that includes warmup handling and exposes the gain in the Data Window. It reports lower forecast errors and reduced trend-initiation lag than a 20-period EMA in EURUSD H1 tests, but gives limited detail on the test design. The method assumes a single random-walk state, does not model drift or autocorrelation, and may be affected by outliers; the article recommends considering winsorized returns and proposes richer state models as extensions.
Key ideas
- A scalar Kalman filter replaces a fixed moving-average weight with a gain recalculated at each bar.
- Process noise is estimated from rolling return variance, while measurement noise is estimated from recent price variance.
- Positive variance floors help prevent degenerate behavior in very quiet markets.
- The described MQL5 indicator provides a warmup period and makes the Kalman Gain available for inspection.
- The random-walk model omits drift and autocorrelation, and outliers can distort its variance estimates.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.