Lipi Reference Lipi

Functions

talib.alma()

Arnaud Legoux Moving Average. It uses Gaussian distribution as weights for moving average.

Syntax

                talib.alma(series float source, series int length, series float offset, series float sigma) → series float
              

Arguments

source required series float Series of values to process.
length required series int Number of bars (length).
offset required series float Controls tradeoff between smoothness (closer to 1) and responsiveness (closer to 0).
sigma required series float Changes the smoothness of ALMA. The larger sigma the smoother ALMA.

Return Type

series float

Example


          indicator("ALMA vs EMA", overlay=true)
length = input(20, title="Moving Average Length")
almaLine = ta.alma(close, length, 0.85, 6)
emaLine = ta.ema(close, length)
plot(almaLine, color=color.blue, title="ALMA", linewidth=2)
plot(emaLine, color=color.red, title="EMA", linewidth=2)