indicator · on price · open source
Arnaud Legoux Moving Average
Running…
Loading chart…
About
Arnaud Legoux Moving Average (ALMA) is a Gaussian-weighted moving average with a tunable offset and sigma. With the default 0.85 offset the kernel weights the recent half of the window, giving low lag and very little noise.
- Move
Offset(0.85) closer to 0 for symmetric smoothing, toward 1 for peakier recent weights. - Lower
Sigmafor a tighter kernel, raise it for broader smoothing. - Excellent swing line on equities and large-cap crypto.
Source code
//@version=5
indicator("Arnaud Legoux Moving Average", overlay=true)
len = input.int(20, "Length", minval=2, maxval=500)
offset = input.float(0.85, "Offset", minval=0, maxval=1, step=0.05)
sigma = input.float(6, "Sigma", minval=0.5, maxval=10, step=0.5)
src = input.source("close", "Source")
alma = 0.5 * (ta.ema(src, math.max(2, math.round(len * offset))) + ta.ema(src, math.max(2, math.round(len * (1.0 - offset)))))
p_ALMA = plot(alma, "ALMA", color=color.navy, linewidth=2)
alertcondition(ta.crossover(close, alma), "Price crosses above ALMA", "Price crossed above the ALMA")
alertcondition(ta.crossunder(close, alma), "Price crosses below ALMA", "Price crossed below the ALMA")
No comments yet.
Sign in to comment.