ALMA
A smooth moving average that weights recent candles along a bell curve to cut lag and noise.
Arnaud Legoux moving average over the last period candles (current included): Gaussian weights w(i) = exp(−(i − m)² ÷ (2s²)), i = 0 for the oldest, m = offset × (period − 1), s = period ÷ sigma. Ready at period candles.
Settings
| Setting | Default | Range | What it does |
|---|---|---|---|
| period | 9 | 1 to 1000 | Candles averaged. |
| offset | 0.85 | 0 to 1 | Centre of the weights: 0 = oldest, 1 = newest. |
| sigma | 6 | 0.1 to 100 | Sharpness: larger = narrower weights. |
What it gives
| Output | What it is |
|---|---|
| alma | The average, in price. |
What it reads
It reads open, high, low, close, hl2, hlc3, ohlc4, hlcc4, close by default.
Warm-up
With its default settings, ALMA needs 9 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.
Test it
Copy this sentence into the Algonney chat to backtest it:
Backtest a strategy on BTC that uses ALMA with its default settings