ema

forge.tafunctionSince Forge API 1
Functionpython
forge.ta.ema(source: ArrayLike, period: int = 14) -> np.ndarray

Exponential average: k = 2 / (period + 1), seeded with the first price.

Parameters

NameTypeDefault
sourceArrayLike
periodint14

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) -> None

Average that weights recent values more, each step closing part of the gap to the price.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint141 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.