Skip to content

Moving Average Calculator

Simple, exponential and weighted moving averages of any data series, with a chart, a point-by-point table and crossovers between a short and a long average.

Calculator Details

Latest 10-period SMA:23.21See results ↓

Oldest first, separated by commas, spaces or new lines (prices, sales…)

All three are shown in the table

Number of values in each average

0 = off; must be longer than the period

Your Results

Latest 10-period SMA: 23.21

Latest 10-period SMA

23.21

20 values

SMA(10)

23.21

EMA(10)

23.3398

α = 0.181818

WMA(10)

23.5336

Moving averages describe past data; a crossover is not a prediction or investment advice.

The latest 10-period SMA of your 20 values is 23.21.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Your series with its 10-period SMA

Your series with its 10-period SMA

Detailed Breakdown

Point by point

Point by point
#ValueSMA(10)EMA(10)WMA(10)
122.27———
222.19———
322.08———
422.17———
522.18———
622.13———
722.23———
822.43———
922.24———
1022.2922.22122.22122.2429
1122.1522.20922.208122.23
1222.3922.22922.241222.2629
1322.3822.25922.266422.2904
1422.6122.30322.328922.3542
1523.3622.42122.516422.5464
1624.0522.61322.795222.8425
1723.7522.76522.968823.0493
1823.8322.90523.125423.2429
1923.9523.07623.275323.4329
2023.6323.2123.339823.5336

How This Calculator Works

How the latest averages are calculated

SMA = (22.15 + 22.39 + 22.38 + 22.61 + 23.36 + 24.05 + 23.75 + 23.83 + 23.95 + 23.63) ÷ 10 = 23.21

WMA = (22.15×1 + 22.39×2 + 22.38×3 + 22.61×4 + 23.36×5 + 24.05×6 + 23.75×7 + 23.83×8 + 23.95×9 + 23.63×10) ÷ 55 = 23.5336

EMA = 0.181818 × 23.63 + (1 − 0.181818) × 23.2753 = 23.3398

α = 2 ÷ (10 + 1). The EMA starts from the simple average of the first 10 values, so early EMA points depend on that seed.

Frequently Asked Questions

What is the difference between SMA, EMA and WMA?

A simple moving average (SMA) gives every value in the window equal weight. A weighted moving average (WMA) gives weights 1, 2, … N, so the newest value counts N times as much as the oldest. An exponential moving average (EMA) gives each new value a fixed share α and lets older values fade gradually without ever dropping out completely. The EMA and WMA react faster to recent changes than the SMA.

How is the EMA smoothing factor calculated?

The usual convention is α = 2 ÷ (N + 1), so a 10-period EMA uses 2 ÷ 11 ≈ 0.1818: each new value gets about 18% of the weight. You can enter α yourself in the advanced options, for example for exponential smoothing of sales where α is chosen by fitting past data.

Why does the EMA start at the simple average?

An EMA needs a previous EMA to start from. The common method (used by StockCharts and most charting packages) is to take the simple average of the first N values as the first EMA. Other software may start from the first value instead, which changes early EMA values but matters less and less as the series gets longer.

What is a moving average crossover?

A crossover happens when a shorter moving average moves from below a longer one to above it, or the reverse. Traders often watch, for example, the 50-day and 200-day averages; a rise above is sometimes called a golden cross and a fall below a death cross. A crossover only describes what prices have done and lags turning points.

Which period should I use?

Shorter periods (5 to 20) follow the data closely and react quickly but are noisy; longer periods (50 to 200) smooth out more noise but lag further behind. For monthly business data, 3 or 12 periods are common: 12 removes seasonal swings from monthly figures.

Can I use this for sales or other data, not just stock prices?

Yes. A moving average smooths any series measured at regular intervals: monthly sales, website visits, temperatures, weekly weight. Enter the values oldest first. Make sure the intervals are equal, because a moving average treats each step as the same length of time.

Why are the first few rows empty?

An N-period average needs N values. The first N − 1 points don’t have a complete window yet, so the table shows a dash. The long average for crossovers starts later still.

Simple, linearly weighted and exponential moving averages (EMA seeded with the first simple average, α = 2 ÷ (N + 1) unless you enter one), following the NIST/SEMATECH e-Handbook and the StockCharts conventions, rounded to 4 decimals. It leaves out other variants (smoothed/Wilder, Hull, double and triple exponential, centred averages), gaps in the data and volume weighting. It describes past data only and is not investment advice.

Moving Average Calculator: SMA, EMA and WMA Explained

By FindMySum · Last reviewed

A moving average smooths a series of numbers by averaging a fixed number of the most recent values at each point. It is one of the most widely used tools in investing and in business forecasting, because it removes day-to-day noise and shows the direction of a trend. This moving average calculator computes the three common types for any series you paste in: simple (SMA), exponential (EMA) and weighted (WMA), plus crossovers between a short and a long average.

Simple moving average (SMA)

The simple moving average of period N is the ordinary mean of the last N values:

SMA = (x₁ + x₂ + … + x_N) ÷ N

As each new value arrives, the oldest one drops out of the window. Every value inside the window counts equally, and a value leaving the window can make the average jump even if nothing new happened. In a spreadsheet, it is AVERAGE over a sliding range.

Weighted moving average (WMA)

A linearly weighted moving average gives the newest value weight N, the one before it N − 1, and so on down to 1 for the oldest:

WMA = (1 × x₁ + 2 × x₂ + … + N × x_N) ÷ (1 + 2 + … + N)

The divisor is N × (N + 1) ÷ 2, which is 55 for a 10-period average. Because recent values count more, the WMA turns sooner than the SMA when the data changes direction.

Exponential moving average (EMA)

The exponential moving average updates the previous average by a fixed share α of the gap between the new value and that average:

EMA_today = α × value_today + (1 − α) × EMA_yesterday

With the usual convention α = 2 ÷ (N + 1), a 10-period EMA gives the newest value about 18% of the weight. Older values never fully drop out; their influence fades geometrically. In statistics the same formula is called single exponential smoothing, where α is often chosen by fitting past data rather than from a period. The first EMA has nothing to update, so it is seeded with the simple average of the first N values.

A worked example

The calculator starts with 20 daily closing prices from the StockCharts teaching example and a 10-period window.

  1. The first complete SMA, at day 10, is the average of the first ten prices: 22.221.
  2. The 10-period EMA starts at that same value. On day 11 the price is 22.15, so EMA = 0.1818 × 22.15 + 0.8182 × 22.221 = 22.208.
  3. By day 20 the SMA is 23.21, the EMA 23.34 and the WMA 23.53. The prices rose sharply from day 14, so the WMA and EMA, which weight recent values more, sit above the SMA.

Choosing a period

The period sets the trade-off between smoothness and lag. A short period follows the data closely but lets noise through; a long one is smooth but responds late. For daily stock prices, 10 or 20 days describe the short-term trend and 50 or 200 days the long-term one. For monthly business data, 3 months smooths noise, and 12 months removes seasonal patterns entirely because every month of the year is always in the window.

Crossovers

Enter a long period to compare two averages of the same type. When the short average rises above the long one, recent values have moved above the longer-term level: an upward crossover. The reverse is a downward crossover. The table marks each crossover, and the results show the most recent one.

Crossovers are popular as trading signals, but they come after the move has started, and in sideways markets they flip back and forth. Treat them as a description of what the data has done.

Practical tips

  • Enter values oldest first, separated by commas, spaces or new lines.
  • Make sure the intervals are equal: a gap such as a missing month distorts every average that spans it.
  • For prices, use closing prices consistently; adjusted closes account for dividends and splits.
  • The calculator rounds results to four decimals, enough for prices and most business data.

This page is for information and learning. It describes past data and is not investment advice.

More questions

What are the 50-day and 200-day moving averages?

They are simple moving averages of a stock's daily closing prices over the last 50 and 200 trading days, roughly ten weeks and ten months. Financial media quote them because many investors watch them, which can make them self-reinforcing reference points. Paste at least 200 closing prices to calculate them here.

Does a moving average work with weekly or monthly data?

Yes. The period is counted in whatever interval your data uses, so a 12-period average of monthly sales covers a year and a 4-period average of weekly data covers about a month. Keep the interval constant through the series.

Why does my charting platform show a slightly different EMA?

Platforms differ in how they start the EMA (first value or first simple average), how many past values they load before your chart begins, and how they round. The differences shrink as more data is used; after a few times N values the starting point barely matters.

Is a moving average the same as a trend line?

No. A trend line is a single straight line fitted to the whole series, usually by least squares. A moving average is recalculated at every point and bends with the data. For a straight-line fit and its slope, use a regression calculator instead.

Can moving averages predict prices?

Not reliably. They summarise past prices and always lag. Research on simple trading rules based on crossovers shows mixed results once trading costs are included. Use them to see the direction of a trend, not as a forecast.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy