← Back to BlogJune 10, 2026Tutorial

Understanding Market Indicators: SMA, EMA, and Kalman Filters

Technical indicators help you extract signal from market noise. In this guide, we'll walk through three indicators available in Kalmate's Pipeline — and show you the actual math with real numbers.

Simple Moving Average (SMA)

The SMA calculates the average price over a fixed window. Each day gets equal weight.

SMA(3) — STEP BY STEP

Using real closing prices from a typical AAPL week

DayCloseSMA(3)Calculation
1100not enough data
2102not enough data
3101101.00(100 + 102 + 101) ÷ 3
4103102.00(102 + 101 + 103) ÷ 3
5105103.00(101 + 103 + 105) ÷ 3

The SMA smooths out daily fluctuations. On day 5, the price jumped to 105, but the SMA only moved to 103 — it lags because it averages the last 3 days equally.

Exponential Moving Average (EMA)

The EMA gives more weight to recent prices, making it more responsive. The formula uses a multiplier: Multiplier = 2 ÷ (period + 1).

EMA(3) — SAME DATA, FASTER RESPONSE

EMA multiplier for period 3: 2 ÷ (3 + 1) = 0.5

DayCloseEMA(3)Formula
1100seed with SMA
2102seed with SMA
3101101.00seed = SMA = 101.00
4103102.00103 × 0.5 + 101 × 0.5
5105103.50105 × 0.5 + 102 × 0.5

Notice the difference on day 5: SMA = 103.00 vs EMA = 103.50. The EMA reacted faster because it weighted the latest price (105) at 50% instead of 33%. This makes EMA better for short-term trading.

Kalman Filter — Adaptive Smoothing

The Kalman filter is a recursive algorithm that estimates the "true" price by filtering out noise. Unlike SMA/EMA which use fixed windows, the Kalman filter adapts to volatility automatically.

// Kalman Filter — Schwartz-Smith 2-Factor Model
state = { trend, cycle }
predict: trend[t] = phi × trend[t-1] + noise
update: state[t] = predict + KalmanGain × (price - predict)
// Default parameters in Kalmate
{ phi: 0.9, mu: 0.0001, sigmaChi: 0.02, sigmaXi: 0.005 }

In Kalmate's Pipeline, the Kalman filter node outputs: smoothed price, trend component, cycle component, and confidence bands. It's particularly useful for noisy markets where SMA/EMA give inconsistent signals.

SMA vs EMA vs KALMAN — WHEN TO USE WHAT

SMA
Best for identifying long-term trend direction. Use SMA(50) and SMA(200) for the classic "golden cross" and "death cross" signals.
EMA
Best for short-term trading. Use EMA(12) and EMA(26) for the MACD crossover strategy. Reacts faster to price changes.
Kalman
Best for volatile/choppy markets where you need adaptive smoothing. The Kalman filter adjusts its sensitivity based on market conditions automatically.

Try It Yourself in the Pipeline

Open Kalmate's Pipeline and build this setup in under 30 seconds:

  1. Add a Symbol Input node, set it to AAPL
  2. Add a Price Feed node, connect from Symbol Input
  3. Add an SMA Indicator (period 20), connect from Price Feed
  4. Add a Kalman Filter, connect from Price Feed
  5. Add two Chart Output nodes, connect SMA to one and Kalman to the other
  6. Compare the smoothed lines — see how Kalman adapts while SMA lags

The Pipeline runs automatically as you build. Change the symbol to BTC-USD or any other ticker and watch both indicators update instantly.