A moving average calculator smooths a series by replacing each observation with an average of the observations around it. That is the whole operation. The output is a description of prices that have already happened, and moving averages describe past prices only — past behaviour does not predict future prices, and nothing on this page is a signal, an entry, or a reason to trade.
Arb Digital publishes this in its free tools library beside the RSI calculator and the pivot point calculator, which are the other two arithmetic indicators in the set. Where the weighted average calculator computes a single weighted mean of a fixed list, this page recomputes the average at every point in a series as the window slides forward. That difference — a rolling window rather than one calculation — is what makes it a moving average.
What This Moving Average Calculator Does
It computes three different moving averages over the same series and the same period, so you can see how much the choice of method changes the answer.
Simple moving average (SMA) adds the last n observations and divides by n. Every observation in the window carries the same weight, and observations outside the window carry none at all.
Weighted moving average (WMA) uses linearly increasing weights: the oldest observation in the window gets weight 1, the next gets 2, and the most recent gets n. The divisor is the sum of the weights, n(n+1)/2.
Exponential moving average (EMA) never drops an observation. Each new value gets weight α and the entire previous average gets weight (1 − α), so older data fades geometrically rather than falling off a cliff. This page uses the standard smoothing constant α = 2 ÷ (n + 1) and seeds the recursion with the simple average of the first n observations, which is the conventional initialisation.
It also computes a fast and a slow average of the same type and reports their relationship over the overlapping window in plain descriptive terms — which one is currently higher, by how much, and where the two last crossed within the data you supplied. That is a statement about your series, not a prediction.
How to Use It
- Enter the series oldest first. Order is everything in a rolling calculation. A reversed series produces a valid-looking average of the wrong window.
- Supply at least as many observations as the slow period. A ten-period average needs ten observations before it exists. Anything shorter is undefined, and the calculator will say so rather than quietly averaging whatever it has.
- Pick the period for a reason. Ten, twenty, fifty and two hundred are conventions inherited from chart software defaults, not results. A shorter window tracks the data more closely and reacts to noise; a longer window is steadier and further behind.
- Compare the three methods before choosing one. On a trending series the EMA and WMA sit closer to the latest price than the SMA, because they weight it more heavily. On a flat series all three converge.
- Read the lag figure alongside the average. It tells you roughly how far behind the price the smoothed line is sitting, which is the cost you pay for the smoothing.
The Formula / How It's Calculated
For a series of prices P and a period n, the simple moving average at time t is:
SMAt = (Pt + Pt−1 + … + Pt−n+1) ÷ n
The weighted moving average applies linear weights, heaviest on the most recent observation:
WMAt = (n·Pt + (n−1)·Pt−1 + … + 1·Pt−n+1) ÷ [n(n+1)/2]
The exponential moving average is recursive. With α = 2 ÷ (n + 1):
EMAt = α·Pt + (1 − α)·EMAt−1, seeded with EMAn = SMAn
Worked example, matching the values the page loads with. The series is 22, 23, 24, 25, 26, 27, 26, 25, 26, 28, 30, 31 and the fast period is 5.
The last five observations are 25, 26, 28, 30 and 31, summing to 140, so SMA = 140 ÷ 5 = 28.0000.
The weighted version multiplies those same five by 1, 2, 3, 4 and 5: 25 + 52 + 84 + 120 + 155 = 436. The divisor is 5 × 6 ÷ 2 = 15, so WMA = 436 ÷ 15 = 29.0667.
The exponential version uses α = 2 ÷ 6 = 0.333333 and seeds at the fifth observation with the simple average of 22, 23, 24, 25 and 26, which is 24. Stepping forward: 24 + 0.333333 × (27 − 24) = 25.0000; then 25.3333, 25.2222, 25.4815, 26.3210, 27.5473 and finally EMA = 28.6982.
The slow ten-period simple average takes the last ten observations, 24 through 31, which sum to 268, giving 26.8000. The fast average is therefore 1.2000 above the slow one, a gap of 4.48%.
Every Moving Average Lags by Construction
This is not a defect to be tuned away. It is what a moving average is.
A simple average of n observations is, in the linear case, centred on the middle of its window. Its centre of mass sits (n − 1) ÷ 2 periods behind the most recent observation. A ten-period simple average is centred 4.5 periods back; a two-hundred-period average is centred 99.5 periods back. Plotting it against the latest price and reading the gap as information mixes a current number with a number describing the recent past.
Exponential and weighted averages reduce the lag but never remove it. For an EMA the centre of mass is approximately 1 ÷ α − 1 periods back, which with α = 2 ÷ (n + 1) works out to (n − 1) ÷ 2 as well — the same nominal lag as the SMA, distributed differently. The EMA responds faster to a large recent move because that observation carries more weight, but it also carries a long tail of old data that the SMA has already discarded. Neither is "better"; they trade one property for another.
The consequence follows directly from the arithmetic: a moving average cannot tell you about a turn until after the turn has begun to show up in the underlying data. Any use of a smoothed line to describe a change of direction is a description of something that has already happened.
SMA, EMA or WMA — What Actually Differs
The three methods differ in how they distribute weight, and that difference matters most exactly when the data is most unusual.
The SMA has a hard edge. When an extreme observation drops out of the back of the window, the average jumps — not because anything happened today, but because something stopped counting. This produces movements in the line that correspond to no event in the current data at all. It is the single most-misread property of simple averages.
The WMA discards the same observation, but gently. The oldest value in the window carries weight 1 out of n(n+1)/2, so its departure is barely felt. The trade is that a single recent outlier carries weight n and moves the line noticeably.
The EMA never discards anything. After n periods roughly 86% of an EMA's weight sits inside the nominal window when α = 2 ÷ (n + 1), and the remaining 14% is spread across all older data. That tail means an EMA computed from a short history differs from one computed from a long history, even at the same date — the seeding choice leaves a residue that decays but never quite vanishes.
None of these properties makes one method correct. They make the methods different, and quoting a moving average without saying which method and which period produced it does not identify a number.
Crossovers Are Descriptions, Not Signals
A crossover is the point where a fast average moves from one side of a slow average to the other. The calculator reports where that last happened inside your data, because it is a fact about the series worth knowing.
What it is not is a signal. The popular names attached to crossovers — the fifty crossing the two hundred, and so on — are conventions from chart software, and the arithmetic that produces them contains no information the underlying prices did not already contain. Two lagging averages crossing is a consequence of price movement that has already occurred, arriving at the chart later than the movement itself.
The evidence on whether such rules produce excess returns is contested and has been for decades. The NBER working paper Foundations of Technical Analysis by Lo, Mamaysky and Wang is the standard academic treatment of how to test these patterns rigorously, and it is worth reading before assuming any pattern has been demonstrated. Whatever conclusion you reach, this page takes no position: it computes averages and reports what your data did.
Two practical cautions apply regardless. Whipsaw — repeated crossings during a range-bound stretch — is a mechanical property of the method, not bad luck. And any test of a crossover rule that uses the same data that suggested the rule is not a test.
Where Moving Averages Are Genuinely Useful Outside Charts
Smoothing has honest applications that involve no forecasting at all.
A twelve-month moving average of monthly revenue removes seasonality and shows the underlying level. A seven-day average of daily traffic removes the weekday cycle. In both cases the point is descriptive: the raw series contains a periodic component you already know about, and averaging over exactly one full cycle removes it cleanly. Choosing a window that matches the known cycle length is the difference between smoothing and blurring.
Moving averages also stabilise noisy ratios. Averaging a conversion rate over a rolling window before comparing periods avoids reacting to a small-sample day, and the standard deviation calculator applied to the same window tells you whether the movement you are looking at is larger than the noise. FINRA's overview of stocks and Investor.gov's guide to types of orders are reasonable places to start on where the prices in a series come from in the first place.
Arb Digital reads traffic, ranking and conversion series the same way — with the seasonality taken out before anyone draws a conclusion from a week's numbers.
See SEO Services Talk to Arb DigitalCommon Mistakes to Avoid
- Comparing averages without naming the method — an SMA, a WMA and an EMA over the same period give three different numbers, and "the 20-day average" identifies none of them on its own.
- Reading an SMA jump as news — when an extreme observation falls out of the back of the window the line moves even though nothing happened in the current period.
- Choosing the period after looking at the chart — picking the window that would have worked on this data is fitting, and it does not survive contact with data you have not seen.
- Treating a crossover as a signal — it is two lagging lines crossing after the underlying price has already moved, and it carries no information the prices did not already contain.
- Entering the series newest first — the arithmetic still runs and the output still looks plausible, which is what makes this error hard to catch.
Related Free Tools From Arb Digital
Run the same price column through the RSI calculator for Wilder's momentum oscillator, or the pivot point calculator for the classic level conventions. For a fixed weighted mean rather than a rolling one use the weighted average calculator, and for dispersion use the standard deviation calculator. On the outcomes side, the stock return calculator and the max drawdown calculator measure what a holding actually did. Everything else is in the free online tools hub.
Frequently Asked Questions
The simple average gives every observation in the window equal weight. The weighted average applies linearly increasing weights so the newest observation counts most. The exponential average never drops an observation at all, fading old data geometrically using a smoothing constant. Over the same period and series they produce three different numbers.
The conventional alpha of 2 divided by the period plus one, so a 5-period EMA uses 0.333333 and a 20-period EMA uses 0.095238. The recursion is seeded with the simple average of the first n observations, which is the standard initialisation used by most charting software.
A simple average of n observations is centred about (n minus 1) divided by 2 periods behind the latest data point, so a 10-period average sits 4.5 periods back. The exponential version has the same nominal centre of mass at the standard alpha but distributes weight differently. Lag is inherent to smoothing, not a fault to be removed.
No. This page describes what your data did and makes no recommendation. A crossover is two lagging averages changing places after the underlying prices have already moved, and it contains no information the price series did not already contain. Moving averages describe past prices and past behaviour does not predict future prices.
There is no correct answer the arithmetic can supply. Common lengths such as 20, 50 and 200 are inherited conventions from charting defaults. Outside price charts, matching the window to a known cycle length — seven days for a weekday pattern, twelve months for annual seasonality — is a defensible reason to pick a number.
Usually because of method, period, price field or history length. Simple and exponential averages differ; closing prices and typical prices differ; and an exponential average computed from a short history retains a residue of its seeding value that a longer history has decayed away. Match all four before assuming an error.
At least as many as the longest period you request. A 10-period average is undefined until the tenth observation exists. For exponential averages more history is better than the minimum, because the influence of the seed value decays with each additional period rather than disappearing at once.
Yes, and it is often more defensible there. Rolling averages of revenue, web traffic or conversion rates remove known periodic patterns and reduce small-sample noise. The arithmetic is identical; only the interpretation changes, and no forecasting claim is involved in describing a smoothed series.
This tool performs an arithmetic calculation on data you supply. It is not investment advice, not a recommendation to buy, sell or hold any security, and its output is not a trading signal. Technical indicators describe past prices only. Decisions about your money should involve a licensed financial adviser regulated in your jurisdiction.