Back to Docs
Traderoid

SMA Pass

Simple Moving Average — Series Input

IndicatorTrendOverlay

Overview

SMA Pass applies the Simple Moving Average to any upstream numeric series. It computes the arithmetic mean of the last `period` values, producing an equal-weight smoothed series. Null is returned for bars with fewer than `period` non-null values in the window.

Formula

SMA[t] = (Σ x[t−i]) / period for i = 0..period−1

Parameters

ParameterTypeDefaultDescription
periodnumber10Window length in bars.

Inputs & Outputs

PortDirectionTypeDescription
inputInput(number | null)[]Any numeric series (values + timestamps).
valuesOutput(number | null)[]Smoothed output series, null for warm-up bars.
timestampsOutputnumber[]Bar timestamps aligned with values.