alma
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.alma(source: ArrayLike,window: int = 9,offset: float = 0.85,sigma: float = 6.0) -> np.ndarrayArnaud Legoux average: Gaussian weights over window bars.
Parameters
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| window | int | 9 |
| offset | float | 0.85 |
| sigma | float | 6.0 |
Indicator: Arnaud Legoux moving average
m = offset * (window - 1), s = window / sigma and the weight of the bar k places
from the oldest is exp(-(k - m)^2 / (2 s^2)). An offset near 1 puts the peak on the
newest bar.
Classpython
forge.ta.ALMA(**inputs: Any) -> NoneGaussian weighted average whose peak you can move toward the newest bar.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| window | int | 9 | 1 to 5000 |
| offset | float | 0.85 | 0 to 1 |
| sigma | float | 6 | 0.5 to 50 |
m = offset * (window - 1), s = window / sigma
w[k] = exp(-(k - m)^2 / (2 * s^2)), k = 0 for the oldest bar of the window
ALMA[i] = sum(w[k] * x[i-window+1+k]) / sum(w[k])