sma
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.sma(source: ArrayLike, period: int = 20) -> np.ndarrayMean of the last period values, each window summed from scratch.
Parameters
| Name | Type | Default |
|---|---|---|
| source | ArrayLike | |
| period | int | 20 |
Indicator: Simple moving average
NaN until period bars exist, and for any window that holds a missing value.
Classpython
forge.ta.SMA(**inputs: Any) -> NoneAverage of the last N values, each weighted equally.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| source | source | close | |
| period | int | 20 | 1 to 5000 |
SMA[i] = (x[i] + x[i-1] + ... + x[i-period+1]) / period
No value until period bars exist. A window holding a missing value has no value.