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
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
average = sma(close, 20)strategyindicatoralertlibrarysince 1.0
ema(source = close, length = 20)→ like source#
Exponential moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
fast = ema(close, 20)strategyindicatoralertlibrarysince 1.0
wma(source = close, length = 20)→ like source#
Linearly weighted moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
weighted = wma(close, 20)strategyindicatoralertlibrarysince 1.0
rma(source = close, length = 14)→ like source#
Wilder's moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 14 | 1 to 5000 | Number of bars in the calculation. |
smoothed = rma(close, 14)strategyindicatoralertlibrarysince 1.0
smma(source = close, length = 14)→ like source#
Smoothed moving average (identical to rma).
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 14 | 1 to 5000 | Number of bars in the calculation. |
smoothed = smma(close, 14)strategyindicatoralertlibrarysince 1.0
hma(source = close, length = 20)→ like source#
Hull moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
hull = hma(close, 20)strategyindicatoralertlibrarysince 1.0
vwma(source = close, length = 20)→ like source#
Volume-weighted moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
by_volume = vwma(close, 20)strategyindicatoralertlibrarysince 1.0
dema(source = close, length = 20)→ like source#
Double exponential moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
double = dema(close, 20)strategyindicatoralertlibrarysince 1.0
tema(source = close, length = 20)→ like source#
Triple exponential moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
triple = tema(close, 20)strategyindicatoralertlibrarysince 1.0
kama(source = close, length = 10, fast = 2, slow = 30)→ like source#
Kaufman's adaptive moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 10 | 1 to 5000 | Efficiency ratio length. |
fast | int | 2 | 1 to 500 | Fastest smoothing length. |
slow | int | 30 | 1 to 5000 | Slowest smoothing length. |
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
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 9 | 1 to 5000 | Number of bars in the calculation. |
offset | number | 0.85 | 0 to 1 | Gaussian offset from 0 to 1. |
sigma | number | 6 | 0.1 to 100 | Gaussian width. |
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
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 5 | 1 to 5000 | Number of bars in the calculation. |
factor | number | 0.7 | 0 to 1 | Volume factor. |
t = t3(close, 5, factor: 0.7)strategyindicatoralertlibrarysince 1.0
zlema(source = close, length = 20)→ like source#
Zero-lag exponential moving average.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | close | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
zero_lag = zlema(close, 20)strategyindicatoralertlibrarysince 1.0