Trend Smoothing
24 algorithms in Technical Indicators · 24 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) -
Triangular Moving Average (TRIMA) verified
Smooths close twice with simple moving averages, an inner window of
floor((period + 1) / 2)followed by an outer window offloor(period / 2) + 1, giving the triangular weighting its name.triangularMovingAverageTrima(input) -
Tillson T3 Moving Average verified
Chains six exponential moving averages of the same
periodover close and combines the third through sixth with the Tillson volume-factor coefficients, trading warm-up length for a smoother, less laggy curve.tillsonT3MovingAverage(input) -
Following Adaptive Moving Average (FAMA) verified
Runs an efficiency-ratio adaptive average over close and its slower follower: net movement across
periodbars divided by the summed absolute bar-to-bar movement sets the smoothing constant, and FAMA tracks MAMA at half that constant.followingAdaptiveMovingAverageFama(input) -
Arnaud Legoux Moving Average (ALMA) verified
Averages close under a Gaussian weight curve whose peak sits at
offset * (period - 1)within the window and whose width isperiod / sigma, so pushing the offset toward 1 favours recent bars.arnaudLegouxMovingAverageAlma(input) -
Fractal Adaptive Moving Average (FRAMA) verified
Estimates the fractal dimension of each
period-bar close window by comparing the ranges of its two halves against the range of the whole, then smooths close withexp(-4.6 * (dimension - 1))as the adaptive constant.fractalAdaptiveMovingAverageFrama(input) -
Zero-Lag Exponential Moving Average (ZLEMA) verified
Removes most of the EMA's lag by first de-lagging close into
2 * close[t] - close[t - lag], wherelagisfloor((period - 1) / 2), and then running an ordinary EMA ofperiodover that adjusted series.zeroLagExponentialMovingAverageZlema(input) -
Least-Squares Moving Average (LSMA) verified
Fits an ordinary least-squares line to each
period-bar window of close and reports the value of that line at the window's last bar, so the curve follows the local trend rather than its average.leastSquaresMovingAverageLsma(input) -
Variable Index Dynamic Average (VIDYA) verified
Scales the EMA constant
2 / (period + 1)by the absolute Chande momentum oscillator of the lastperiodone-bar changes, so the average speeds up in one-sided moves and nearly freezes when gains and losses balance.variableIndexDynamicAverageVidya(input) -
McGinley Dynamic verified
Tracks close with McGinley's self-adjusting recursion, dividing the step toward the new close by
k * period * (close / previous) ** 4so the line accelerates when price runs away from it and coasts when price is near.mcginleyDynamic(input) -
Jurik-Style Moving Average Design verified
Demonstrates the Jurik design idea without the proprietary internals: the current absolute bar-to-bar change is scored against its own
period-bar average, and that score stretches a base smoothing constant between a floor and a ceiling before the average is applied to close.jurikStyleMovingAverageDesign(input) -
Volume-Weighted Moving Average (VWMA) verified
Averages close over a rolling
period-bar window using each bar'svolumeas its weight, so heavily traded bars pull the line further than quiet ones.volumeWeightedMovingAverageVwma(input) -
Quadratic-Weighted Moving Average verified
Averages close over a rolling
period-bar window with weights that grow as the square of a bar's position, 1, 4, 9 and so on, front-loading recency harder than the linear weights of a WMA.quadraticWeightedMovingAverage(input) -
Gaussian Moving Average verified
Averages close under a Gaussian weight curve centred at
offset * (period - 1)with widthperiod / sigma. The default offset of 0.5 puts the peak in the middle of the window, which is what separates this from ALMA's recency-shifted variant of the same kernel.gaussianMovingAverage(input) -
Ehlers Super Smoother Filter verified
Applies Ehlers' two-pole Butterworth recursion to the two-bar mean of close, with feedback coefficients derived from
periodviaexp(-sqrt(2) * pi / period), suppressing high-frequency noise with far less lag than a moving average of the same length.ehlersSuperSmootherFilter(input) -
Ehlers Instantaneous Trendline verified
Splits close into a smoothed centre line and what is left over: the trendline is an EMA of
max(4, period)and the detrended series is the bar's close minus that trendline.ehlersInstantaneousTrendline(input)
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 137 algorithms across 9 families. For the concept behind this family rather than the call signatures, see the concept guides.