ema
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.ema(source: ArrayLike, period: int = 14) -> np.ndarrayExponential average: k = 2 / (period + 1), seeded with the first price.
Parameters
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| period | int | 14 |
Indicator: Exponential moving average
The first period - 1 values of each unbroken run are left empty. After a gap the recursion
restarts and waits period - 1 bars again.
Classpython
forge.ta.EMA(**inputs: Any) -> NoneAverage that weights recent values more, each step closing part of the gap to the price.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 14 | 1 to 5000 |
k = 2 / (period + 1)
EMA[i] = x[i] * k + EMA[i-1] * (1 - k), starting from the first price.
The first period - 1 values are left empty. After a gap the average starts again.