Skip to content
Finance

Moving Average Calculator (SMA, EMA, WMA)

Enter your data points separated by commas, choose a period and a moving average type, and get a complete breakdown table plus a line chart comparing your raw data against the smoothed series. Supports Simple (SMA), Exponential (EMA), and Weighted (WMA) moving averages. Results update as you type.

Your details

Separate values with commas, spaces, or line breaks. At least (period + 1) values required.
How many consecutive data points are averaged together. Common choices: 3, 5, 10, 20, 50, 200.
periods
SMA weights all periods equally. EMA applies an exponential multiplier so recent values matter more. WMA uses integer weights from 1 to n.
Latest moving average
54.3333

The most-recent moving average value from the series

MA values computed10
Data points entered12
Raw series mean49.5833
First moving average45.3333
MA range (min to max)45.3333 to 54.3333
Raw series mean49.5833
Latest MA value54.3333
First MA value45.3333
028561712
Period
  • Raw data
  • SMA(3)

Simple MA (3-period): 54.3333

  • The latest data point (56) is above the 3-period Simple MA (54.3333), a potential uptrend signal.
  • The latest MA (54.3333) is above the overall series mean (49.5833) by 9.58%.
  • Your 12-point series produced 10 Simple MA values using a period of 3.
  • SMA treats each period equally, making it simpler and less sensitive to sudden spikes than EMA or WMA.

Next stepCompare SMA, EMA, and WMA using the type selector to see how each method weights historical data differently.

SMA(3) Calculation Table

PeriodRaw ValueSMA(3)
144-
245-
34745.3333
44646.0000
54847.0000
65048.0000
74949.0000
85150.0000
95250.6667
105352.0000
115453.0000
125654.3333

SMA requires 3 data points before the first value can be computed. Rows showing "-" are the initial warm-up periods.

Formula

SMAn=P1+P2++Pnn,EMAt=Ptk+EMAt1(1k),  k=2n+1,WMAn=i=1niPii=1ni\text{SMA}_n = \frac{P_1 + P_2 + \cdots + P_n}{n}, \quad \text{EMA}_t = P_t \cdot k + \text{EMA}_{t-1} \cdot (1-k),\; k=\frac{2}{n+1}, \quad \text{WMA}_n = \frac{\sum_{i=1}^{n} i \cdot P_i}{\sum_{i=1}^{n} i}

Worked example

For data [44, 45, 47, 46, 48] with a 3-period SMA: window 1 = (44+45+47)/3 = 45.33; window 2 = (45+47+46)/3 = 46.00; window 3 = (47+46+48)/3 = 47.00. The 3-period EMA seeds at 45.33, then applies k = 2/(3+1) = 0.5, so the next EMA = 46 x 0.5 + 45.33 x 0.5 = 45.67.

What is a moving average?

A moving average (MA) is a statistical method that smooths out short-term fluctuations in a data series by averaging consecutive groups of values over a fixed window called the period. Because the window slides forward by one point at a time, the result is a new series that follows the general trend of the original data while dampening noise. Moving averages are used everywhere from financial charting and signal processing to demand forecasting and epidemiology. The key decision you face each time is choosing the period and the weighting scheme, both of which control how responsive the smoothed line is to recent changes.

SMA vs EMA vs WMA: which type should you use?

The Simple Moving Average (SMA) gives equal weight to every data point in the window. It is the most straightforward to calculate and understand, and it is less sensitive to sudden spikes or outliers. The downside is that it reacts slowly to new information because yesterday's data counts exactly as much as today's. The Exponential Moving Average (EMA) applies a multiplier k = 2/(n+1) that gives the most-recent value a higher weight and lets older values fade exponentially over time. A 10-period EMA with k = 0.182 means today's value contributes about 18.2% to the result. EMA reacts faster than SMA to price changes, which is why it is preferred for short-term trading strategies. The Weighted Moving Average (WMA) uses linear integer weights from 1 to n, so the newest value carries weight n, the second-newest carries n-1, and so on. WMA is more responsive than SMA but less extreme than EMA in how it discounts older data. It is commonly used in situations where a smooth but still trend-sensitive output is needed.

How to read a moving average chart

Plot both the raw data series and the moving average line on the same chart. When the raw price line crosses above the MA from below, that is called a bullish crossover and often signals the start of an uptrend. When price crosses below the MA from above, that is a bearish crossover and may signal a downtrend. A narrow gap between price and the MA suggests consolidation, while a widening gap indicates accelerating momentum in the direction of the gap. The longer the period, the smoother the MA line and the fewer (but more significant) crossovers it will produce. Traders often combine a short-period MA with a long-period MA: when the short MA crosses above the long MA that is called a Golden Cross (bullish); when it crosses below it is called a Death Cross (bearish).

Practical limitations of moving averages

Moving averages are lagging indicators: they summarize past data, so they always trail the current price. This lag grows with the period length. A 200-period SMA on daily data will not confirm a trend reversal until weeks or months after it began. Using a shorter period reduces lag but increases false signals. Moving averages also perform poorly in sideways or choppy markets, where prices oscillate around the MA without establishing a clear trend, generating repeated crossovers that would cause losses in a trend-following strategy. For best results, combine the MA with momentum indicators such as RSI or MACD, or with volume analysis, rather than relying on it in isolation.

Common moving average periods and uses

PeriodTypical useAsset class
3Very short-term smoothing, intraday signalsStocks, crypto, commodities
5Weekly trend on daily chartsStocks, ETFs
10Two-week momentum on daily chartsStocks, ETFs
20Monthly trend, Bollinger Bands basisStocks, forex, crypto
50Medium-term trend, widely watched support/resistanceStocks, indices, forex
100Long-term trend filterStocks, indices
200Long-term bull/bear market signal (Golden/Death Cross)Stocks, indices, crypto

Standard period choices used by traders and analysts across different timeframes.

Frequently asked questions

What period should I use for a moving average?

The right period depends on your timeframe and purpose. For short-term signals on daily data, 5-20 periods are common. For medium-term trend analysis, 50 periods is widely watched. For long-term trend filters, 100 or 200 periods are standard. In general, start with the period most commonly used in your market (20 or 50 for stocks) and adjust based on whether you want more sensitivity (shorter period) or more smoothness (longer period).

What is the difference between SMA and EMA?

SMA gives equal weight to every data point in the window. EMA applies an exponential decay factor so that recent points carry more weight than older ones. For the same period length, EMA reacts faster to new data than SMA. This makes EMA better for trend-following in fast-moving markets, while SMA is better for filtering out noise in slower-moving or mean-reverting series.

How many data points do I need before the first MA value appears?

For SMA and WMA you need exactly n data points to produce the first moving average value, where n is your period. A 10-period SMA on 15 data points will produce 6 MA values (positions 10 through 15). For EMA the same applies: the first EMA is seeded as the SMA of the first n values, and from there each new data point produces one additional EMA value.

Can I use a moving average for non-financial data?

Yes. Moving averages are a general smoothing technique used in many fields. Common examples include smoothing daily temperature readings or rainfall totals in meteorology, tracking the 7-day rolling average of infection rates in epidemiology, smoothing sensor readings in engineering, and forecasting demand in supply-chain planning. The math is identical regardless of what the values represent.

What is a Golden Cross and a Death Cross?

A Golden Cross occurs when a short-period moving average (often the 50-day SMA) crosses above a longer-period moving average (often the 200-day SMA). It is widely regarded as a long-term bullish signal. A Death Cross is the opposite: the short-period MA crosses below the long-period MA, signaling a potential long-term downtrend. These crossovers are lagging signals and work best in trending markets, not in sideways, range-bound conditions.

Sources

Written by Sarah Klein, CFP Certified Financial Planner · Chicago, USA

Fifteen years translating mortgage tables and amortization schedules into decisions that actually help real borrowers.

Search 3,500+ calculators

Loading search…