Trend Smoothing
9 algorithms in Technical Indicators · 9 with asserted arithmetic.
In this family#
-
Simple Moving Average (SMA) verified
Arithmetic mean of the last
windowobservations, emitted at every position where a complete window is available.calculateSma(values, window) -
Exponential Moving Average (EMA) verified
Exponentially weighted mean seeded with the simple mean of the first
spanobservations, so the series is reproducible rather than dependent on where the data starts.calculateEma(values, span) -
Weighted Moving Average (WMA) verified
Linearly weighted mean over
windowobservations: the most recent observation carries weightwindow, the oldest weight 1.calculateWma(values, window) -
Wilder RMA verified
Wilder's smoothing — an exponential mean with decay 1 / period rather than 2 / (period + 1). This is the smoother RSI, ATR and ADX are defined against, and substituting a standard EMA changes their published values.
calculateRma(values, period) -
Double Exponential Moving Average (DEMA) verified
Double exponential moving average:
2 × EMA − EMA(EMA). Subtracting the second smoothing pass cancels most of the lag a single EMA introduces, at the cost of overshooting sharp reversals.calculateDemaComponents(values, span) -
Triple Exponential Moving Average (TEMA) verified
Triple exponential moving average:
3 × EMA − 3 × EMA(EMA) + EMA(EMA(EMA)). More lag cancellation than DEMA, and correspondingly more overshoot.calculateTemaComponents(values, span) -
Hull MA verified
Hull moving average: a weighted combination of two WMAs de-lagged against each other, then re-smoothed over sqrt(window). Far more responsive than an SMA of the same length, at the cost of overshoot.
calculateHullMa(values, window) -
Kaufman Adaptive Moving Average (KAMA) verified
Kaufman adaptive moving average. The smoothing constant moves between a fast and a slow bound according to an efficiency ratio — directional travel divided by total travel — so the average tightens in a trend and loosens in noise.
calculateKama(values, efficiencyPeriod, fastPeriod, slowPeriod) -
MESA Adaptive Moving Average (MAMA) verified
MESA adaptive moving average. A Hilbert transform estimates the dominant cycle period of the series, and the smoothing rate follows the rate of phase change — so the average adapts to cycle length rather than to a fixed window.
mama(values, fastLimit, slowLimit)
What they share#
Every topic here is a series-transform, so once you have
called one the rest follow the same shape. Import paths differ only in the final segment:
import { calculateSma } from "fintech-algorithms/technical-indicators/trend-smoothing/sma";
import { calculateEma } from "fintech-algorithms/technical-indicators/trend-smoothing/ema";Read them in the order above — the sequence is pedagogical, not alphabetical.
Where this sits#
Technical Indicators collects 37 algorithms across 5 families. For the concept behind this family rather than the call signatures, see the concept guides.