Simple moving average

smamoving_averagesForge API 1

Average of the last N values, each weighted equally.

Inputs

NameTypeDefaultRange
sourcesourceclose
periodint201 to 5000

Outputs

NameTypeRequiredDescription
smavalueOptionalcolor theme.accent, style line, width 1
Warm-up
period - 1 bars (19 at the defaults)
Repaints
No
Parity
TA-Lib, within 1e-9

Formula

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.