Superseded (2026-05-25) — this operator is a Layer-1 transform, not a Layer-0 atomic input. Merged into
compute_sma_v1. Kept for history.
What (One-liner)
Thin wrapper for pandas rolling mean, basic primitive for technical indicators.
How to use
python
from services.algo.technical import compute_sma
compute_sma(prices, period=20)Core formulas
sma_t = prices.rolling(window=period).mean()[t]Assumptions & applicability
Assumptions: Equidistant timestamps + pd.Series/list input + window≥2.
Applicability: Price smoothing, MACD components, GC/DC strategies.
Out of scope: weighted MA (EMA), adaptive window.
Known limitations
- Left-aligned (NaN prefix)
- period default 20
- Does not handle calendar gap
References
Murphy (1999) Technical Analysis.
Golden Test
tests/golden/fixtures/tier1/compute_sma/, 1e-12, 2026-04-20 passing.
Changelog
- 1.0.0 (2026-04-20) — Initial Active

