Skip to content
OverCalculator
  1. Home
  2. Financial
  3. Moving Average Calculator
Financial

Moving Average Calculator

Calculate the latest simple moving average from a chronological price list, compare it with the latest price, and see whether the average is rising, falling, or flat.

Published

Latest moving average
3-period simple moving average
$106.00
Latest price
$110.00
Price vs. moving average
$4.00
Previous moving average
$103.67
Moving-average trend
rising
Number of averages
3

Uses the latest 3 prices: $102.00, $106.00, $110.00.

Price
Price 1
$
Price 2
$
Price 3
$
Price 4
$
Price 5
$

Results update as you type.

Moving Average Calculator

The moving average calculator computes a simple moving average from a list of prices. Enter a length and a chronological series of prices, oldest first, and the result includes the latest moving average, the latest price, the dollar gap between the latest price and the average, the previous moving average, the trend of the average, and the number of rolling averages created. It is an informational tool, not trading advice.

Moving averages are popular because they reduce a noisy price series to a single rolling benchmark. They do not remove risk. They also do not predict future prices, because they are calculated only from data that already happened. A sudden earnings release, macro announcement, halt, gap, or liquidity shock can make a smooth average irrelevant in seconds.

What the result represents

This component uses a simple moving average, sometimes abbreviated SMA. It does not calculate a weighted moving average despite the broader phrase “moving average” sometimes including weighted, exponential, triangular, or volume-based variants. In this method, every price in the selected window has equal importance. the inputs rounds the length to a whole number, requires a length of at least 2, and requires at least as many prices as the length.

If the length is 3 and the price list has five values, the calculator builds three windows: prices 1 through 3, prices 2 through 4, and prices 3 through 5. The final window creates the primary result. The immediately preceding window creates the “previous moving average” item. The latest price is the final price in your list, and the price gap is latest price minus latest moving average.

For related technical pages, use the RSI calculator for momentum, the pivot point calculator for prior-range support and resistance levels, and the fibonacci retracement calculator for percentage pullback levels. Portfolio-specific arithmetic lives in the stock average calculator and stock split calculator.

Formula

For a window containing n prices, the simple moving average is:

SMA=price 1+price 2++price nn\text{SMA} = \frac{\text{price 1} + \text{price 2} + \cdots + \text{price n}}{\text{n}}

The next average drops the oldest price in the previous window and adds the next price in the series. The calculator repeats that process until it reaches the latest complete window.

Checking a moving average scenario

Use the default price list 101, 103, 102, 106, and 110 with a length of 3. The first rolling average is 101 plus 103 plus 102, divided by 3, which equals 102.00. The second rolling average is 103 plus 102 plus 106, divided by 3, which equals 103.67. The latest rolling average is 102 plus 106 plus 110, divided by 3, which equals 106.00.

The latest price is 110.00. The price versus moving average gap is 110.00 minus 106.00, or 4.00. The previous moving average is 103.67. Because 106.00 is higher than 103.67, the moving-average trend item reads rising. The number of averages is 3, matching the three rolling windows generated from five prices and a three-period length.

Change the length to 4 with the same prices and the result changes. The windows are 101, 103, 102, 106 and 103, 102, 106, 110. Their averages are 103.00 and 105.25, so the latest 4-period SMA is 105.25 and the trend is still rising. This illustrates why moving-average settings must be documented when comparing signals.

How traders use moving averages

Traders use moving averages to describe trend direction, identify areas where price has moved far from a recent norm, and compare a faster average with a slower one. A rising average can show that recent prices are generally higher than prior prices. A falling average can show the opposite. Some traders watch whether price is above or below the average; others watch crossovers between two averages.

Those interpretations are not guarantees. A moving average lags because it waits for prices to enter and leave the window. A shorter length reacts faster but creates more false alarms. A longer length is smoother but can respond too late after a major move. Markets can also move sideways, causing frequent crosses that look meaningful but lead nowhere after spreads, slippage, and fees.

Use the calculator to make the arithmetic explicit, not to outsource judgment. If you are evaluating a strategy, record the length, data interval, symbol, source of prices, and whether prices are adjusted for dividends or splits. Without those details, two moving averages with the same label can describe different data.

Common mistakes

  • Entering prices newest first, which makes the previous and latest windows point to the wrong parts of the series.
  • Mixing daily, weekly, and intraday prices in the same list.
  • Comparing a simple moving average with an exponential moving average as if they used the same weighting.
  • Choosing a length after seeing the result and then treating it as objective.
  • Assuming a price above the average must keep rising.

Sources

  • CFI, Moving Average — background on moving-average formulas and common technical-analysis applications.

Frequently asked questions

Why should prices be entered oldest to newest?
The calculator builds rolling windows in the order you provide. It treats the final row as the latest price, uses the final window for the primary moving average, and compares that result with the previous window to label the trend.
What happens if my length is longer than my price list?
The input is invalid because there are not enough prices to fill one complete window. Add more prices or choose a shorter length. The length must be at least 2 and is rounded to a whole number.
How is the trend label calculated?
The latest simple moving average is compared with the previous simple moving average. If the latest average is higher, the trend label is rising. If it is lower, the label is falling. If both are equal, the label is flat.
Is this moving average trading advice?
No. The calculator is informational and only shows arithmetic based on your entries. Traders may use moving averages as one input, but a crossover or price gap does not guarantee any outcome or make a trade suitable.

Related calculators

Moving Average Calculator updated at