Moving Average Calculator (SMA & EMA)

Compute Simple Moving Average (SMA) and Exponential Moving Average (EMA) from your time series. Paste prices, sales, or any numeric series (oldest to newest), choose the period, and the tool will show the latest averages, a full table, and an inline chart.

e.g. 3, 5, 10

Blue: original data; Orange: selected moving average. First 30 points shown.

Latest MA

Current price/value

Diff (value - MA)

Method

t Value MA Diff

Formulas

Simple moving average (SMA):

\( \text{SMA}_t = \dfrac{X_t + X_{t-1} + \dots + X_{t-n+1}}{n} \)


Exponential moving average (EMA):

\( \alpha = \dfrac{2}{n+1} \quad\Rightarrow\quad \text{EMA}_t = \alpha X_t + (1 - \alpha)\text{EMA}_{t-1} \)

with initialization \( \text{EMA}_1 = X_1 \).

When to use SMA vs EMA

  • SMA: easy to interpret, good for smoothing.
  • EMA: reacts faster to recent moves (used a lot in trading, e.g. 12/26 EMA).

Common periods

Finance: 5, 10, 20, 50, 100, 200. Operations/time series: 3, 4, 6, 12 depending on seasonality.


Audit: Complete
Formula (LaTeX) + variables + units
This section shows the formulas used by the calculator engine, plus variable definitions and units.
Formula (extracted LaTeX)
\[','\\]
','\
Formula (extracted text)
Simple moving average (SMA): \( \text{SMA}_t = \dfrac{X_t + X_{t-1} + \dots + X_{t-n+1}}{n} \) Exponential moving average (EMA): \( \alpha = \dfrac{2}{n+1} \quad\Rightarrow\quad \text{EMA}_t = \alpha X_t + (1 - \alpha)\text{EMA}_{t-1} \) with initialization \( \text{EMA}_1 = X_1 \).
Variables and units
  • No variables provided in audit spec.
Sources (authoritative):
Changelog
Version: 0.1.0-draft
Last code update: 2026-01-19
0.1.0-draft · 2026-01-19
  • Initial audit spec draft generated from HTML extraction (review required).
  • Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
  • Confirm sources are authoritative and relevant to the calculator methodology.
Verified by Ugo Candido on 2026-01-19
Profile · LinkedIn
, ', svg: { fontCache: 'global' } }; ]], displayMath: [['\\[','\\]']] }, svg: { fontCache: 'global' } };, svg: { fontCache: 'global' } };