Moving averages reference

All 13 moving averages in AlgoBarsX, each with its parameters, defaults, ranges and an example: sma, ema, wma, rma, smma, hma, vwma, dema, tema, kama and 3 more.

sma ema wma rma smma hma vwma dema tema kama alma t3 zlema

sma(source = close, length = 20)→ like source#

Simple moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula Arithmetic mean of the last length values.

Warm-up length bars

Example
average = sma(close, 20)
strategyindicatoralertlibrarysince 1.0

ema(source = close, length = 20)→ like source#

Exponential moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula alpha = 2 / (length + 1), seeded with the SMA of the first length values.

Warm-up length bars

Example
fast = ema(close, 20)
strategyindicatoralertlibrarysince 1.0

wma(source = close, length = 20)→ like source#

Linearly weighted moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula Weights length, length - 1, ..., 1 from newest to oldest.

Warm-up length bars

Example
weighted = wma(close, 20)
strategyindicatoralertlibrarysince 1.0

rma(source = close, length = 14)→ like source#

Wilder's moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint141 to 5000Number of bars in the calculation.

Formula alpha = 1 / length, seeded with the SMA of the first length values.

Warm-up length bars

Example
smoothed = rma(close, 14)
strategyindicatoralertlibrarysince 1.0

smma(source = close, length = 14)→ like source#

Smoothed moving average (identical to rma).

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint141 to 5000Number of bars in the calculation.
Example
smoothed = smma(close, 14)
strategyindicatoralertlibrarysince 1.0

hma(source = close, length = 20)→ like source#

Hull moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula wma(2 * wma(source, length / 2) - wma(source, length), round(sqrt(length)))

Example
hull = hma(close, 20)
strategyindicatoralertlibrarysince 1.0

vwma(source = close, length = 20)→ like source#

Volume-weighted moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.
Example
by_volume = vwma(close, 20)
strategyindicatoralertlibrarysince 1.0

dema(source = close, length = 20)→ like source#

Double exponential moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula 2 * ema - ema(ema)

Example
double = dema(close, 20)
strategyindicatoralertlibrarysince 1.0

tema(source = close, length = 20)→ like source#

Triple exponential moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.

Formula 3 * ema - 3 * ema(ema) + ema(ema(ema))

Example
triple = tema(close, 20)
strategyindicatoralertlibrarysince 1.0

kama(source = close, length = 10, fast = 2, slow = 30)→ like source#

Kaufman's adaptive moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint101 to 5000Efficiency ratio length.
fastint21 to 500Fastest smoothing length.
slowint301 to 5000Slowest smoothing length.
Example
adaptive = kama(close, 10, fast: 2, slow: 30)
strategyindicatoralertlibrarysince 1.0

alma(source = close, length = 9, offset = 0.85, sigma = 6)→ like source#

Arnaud Legoux moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint91 to 5000Number of bars in the calculation.
offsetnumber0.850 to 1Gaussian offset from 0 to 1.
sigmanumber60.1 to 100Gaussian width.
Example
smooth = alma(close, 9, offset: 0.85, sigma: 6)
strategyindicatoralertlibrarysince 1.0

t3(source = close, length = 5, factor = 0.7)→ like source#

Tillson T3 moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint51 to 5000Number of bars in the calculation.
factornumber0.70 to 1Volume factor.
Example
t = t3(close, 5, factor: 0.7)
strategyindicatoralertlibrarysince 1.0

zlema(source = close, length = 20)→ like source#

Zero-lag exponential moving average.

Parameters

NameTypeDefaultRangeWhat it is
sourceseries<number>closeSeries to calculate from.
lengthint201 to 5000Number of bars in the calculation.
Example
zero_lag = zlema(close, 20)
strategyindicatoralertlibrarysince 1.0

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account