Skip to content
UseCalcNow
Finance

Moving Average Calculator — SMA, EMA & WMA

Compute SMA, EMA, and WMA from your price series, compare the latest close to the average, and read the golden or death cross regime.

About This Calculator

A moving average turns a noisy series of closes into one smoothed line by averaging the most recent N observations. This calculator computes all three workhorse versions — simple (SMA), exponential (EMA), and linearly weighted (WMA) — from your six most recent closes, flags how far the latest close sits from the average, and grades the short-versus-long regime when you enter a longer-term MA. The defaults model a stock trading at 108.90 with a 5-period window and a 100.50 long-term average, so you can see each output before entering your own numbers.

The Formula Behind This Calculator

The SMA takes the arithmetic mean of the newest N closes — every observation carries the same weight, so a 20-period SMA gives each close exactly 5% of the value. The EMA replaces equal weights with a smoothing factor k = 2 / (N + 1); each new close gets weight k and the running average keeps (1 − k), so for N = 10 the factor is 0.1818 and the newest ten observations end up carrying about 86.6% of the total weight. The WMA assigns linearly rising weights (1, 2, 3 … N, oldest to newest), which sits between the two. This tool seeds the EMA with the SMA of the first N points, the standard charting convention, then applies the smoothing factor to each remaining close; with six entered points and any window of six or more, the EMA still equals its seed, and the explanation says so. When the window exceeds the number of closes you entered, the average runs on the newest points available and the output is labeled partial. Entering a long-term MA value (say, a 50-day average pulled from your chart) adds the crossover read: the selected average above the long MA marks a golden-cross regime, below it a death-cross regime.

Understanding the math helps you verify results and make better decisions for your project.

How to Use

  1. 1Enter your six most recent closes in order, oldest in Close 1 and the latest bar in Close 6 — leave unused fields at 0 if you track a shorter series.
  2. 2Set the window length N to match the average you follow: 9 or 10 for short-term swings, 20 for the month-scale trend, 50 or 200 for regime calls.
  3. 3Pick the type: SMA for the classic equal-weight version, EMA for faster response, WMA for a linear speed-up with no exponential memory.
  4. 4Optionally enter the value of a longer average from your chart (the 50-day or 200-day line) to get the golden-cross or death-cross verdict.
  5. 5Read the headline number, then check the explanation line for all three averages, the distance of the close, and any partial-window warning.

When to Use

  • →Checking whether the latest close holds above the average you trade against before entering or adding to a position.
  • →Deciding between SMA and EMA for a specific strategy by seeing how far apart the two land on the same six closes.
  • →Confirming a golden cross or death cross regime once your chart's short average approaches the long one.
  • →Smoothing a noisy operational series — daily sales, traffic, server load — where the trend matters more than any single day.
  • →Sanity-checking a breakout: price stretched several percent above its moving average often mean-reverts before continuing.

Tips

  • ✓Match the window to your holding period: a 5-day average on a monthly position whipsaws, while a 200-day average on a day trade arrives a quarter late.
  • ✓Wait for the bar to close before acting on a cross — intraday spikes flip signals that evaporate by the session close.
  • ✓Give the EMA roughly 3N observations before trusting it: a 10-period EMA carries 86.6% of its weight in the newest ten bars and 99.8% only by bar thirty.
  • ✓Treat stacked averages (20 above 50 above 200) as one signal, not three confirmations — they are highly correlated versions of the same trend.
  • ✓In a sideways market, average-crossover signals churn; fade the band extremes or stand aside until a range breaks.
  • ✓Backtest the specific cross on your actual instrument and timeframe before risking money — published results usually survive fewer transaction costs than claimed.

What a Moving Average Actually Measures

A moving average answers one question: where has price been settling over the last N periods? Slide a window of fixed length across the series, average whatever falls inside it, and plot the result — the jagged closes flatten into a line you can read at a glance. Traders care because the raw series buries the trend in noise; a single down day inside an uptrend means nothing, but a down day that drags the 20-period average sideways tells you momentum is fading.

The cost of that smoothing is lag. An SMA mechanically trails price by (N − 1) / 2 periods in a steady trend: 2 periods for a 5-day average, 9.5 for a 20-day, 24.5 for a 50-day, and 99.5 for a 200-day. That is not a flaw to engineer away — it is the price of filtering noise. Every trick that reduces lag (shorter windows, exponential weighting, weighted closes) feeds more noise back into the line. The whole craft of using averages is choosing which mistake you prefer.

On the default series loaded in this calculator — closes running 101.20, 103.45, 102.80, 105.60, 107.15, 108.90 with a 5-period window — the SMA lands at 105.58 while the latest close prints 108.90, leaving price 3.14% above the average. That spread is the first thing experienced traders check: price stretched far above its average tends to snap back toward it, giving both entry timing for pullback traders and warning for chasers. For measuring an entire trade from buy to sell, pair it with the holding period return calculator.

SMA vs EMA vs WMA — Three Formulas, One Series

The simple moving average gives every close in the window identical weight. The exponential moving average replaces that with a smoothing factor k = 2 / (N + 1): each new close contributes k, and the running average retains 1 − k. For N = 10 that factor is 0.1818, which stacks 86.6% of the EMA's total weight into the newest ten bars; older bars never fully drop out, they just fade geometrically. The linearly weighted average splits the difference with weights that climb 1, 2, 3 … N from oldest to newest.

Run all three over the default series at window 5 and the personalities show immediately: SMA 105.58, EMA 105.66, WMA 106.60. The WMA reads highest because the newest closes (107.15 and 108.90) dominate its arithmetic; the EMA nudges above the SMA for the same reason but keeps one foot in its SMA seed; the SMA treats the 102.80 dip as an equal citizen. None of them is wrong — they answer the same question with different clocks.

The EMA hides one property worth knowing: it remembers everything. Its seed — the SMA of the first N points — only washes out slowly, which is why practitioners give an EMA about 3N observations to converge (a 10-period EMA reaches 99.8% weight on its newest thirty bars). This tool prints that convention honestly: the EMA is seeded with its SMA, so short series with windows at or above the entered count return EMA = SMA, flagged in the explanation rather than hidden.

The Lag Test: What Happens When Price Jumps

The cleanest way to feel the lag difference is a step change. Take five closes at 100.00, then two at 110.00 and 120.00, and run a 5-period window: the SMA reads 106.00, the EMA 108.00, the WMA 109.33. Price now sits 14.00 above the SMA, 12.00 above the EMA, and 10.67 above the WMA. All three undershoot the new level — no average of the past can reach it — but the weighted versions close most of the gap first.

That responsiveness is a trade, not a free lunch. The same weighting that lets the WMA and EMA turn quickly in a genuine breakout also lets them flip direction on a one-bar spike that the SMA correctly ignores. Day traders running a 9-period EMA accept the whipsaw because their holding period is hours; a pension desk running a 200-day SMA accepts the delay because its holding period is years. When someone insists one average is superior, ask superior for whom and for what holding period.

A practical middle path used by many swing traders: use the faster average for timing and the slower one for permission. Enter on a pullback to the 20-day only when price holds above the 50-day, so the fast line handles the entry and the slow line vetoes counter-trend trades. The averaging you do on entries compounds — small per-trade improvements multiply across a career the same way returns do in the compound growth calculator.

Reading the Crossover: Golden Cross and Death Cross

Enter the current value of a longer average in the Long-Term MA field and the tool grades the regime: the selected average above the long line is a golden-cross regime, below it a death-cross regime. The classic pair is the 50-day crossing the 200-day, studied endlessly on the S&P 500. On the defaults here, the 5-period average of 105.58 sits 5.05% above the 100.50 long-term value — a confirmed golden-cross regime; flip the long value to 112.00 and the verdict swings to 5.73% below, a death-cross regime.

Two honest caveats come with the famous crosses. First, they are late: by the time a 50-day average climbs over a 200-day, a large part of the move already happened, because the signal averages roughly a year of closes. Second, they churn in sideways decades — some of the worst whipsaw sequences in index history came from crosses that fired in range-bound markets and reversed within weeks. The signal works best as a regime switch (be long-leaning above, defensive below) rather than a timing trigger.

Crossovers pair naturally with level-based tools. A golden cross that fires while price sits far above support invites chasing; the same cross on a retracement toward the average is a different trade. Chartists often confirm regime with the fibonacci retracement calculator, measuring how deep the pullback runs before the trend resumes — the cross tells you the direction, the retracement tells you the entry.

Choosing a Window Length That Fits

The conventions exist for a reason. A 10-period window suits intraday and short-swing work; 20 approximates a month of trading sessions and anchors most intermediate systems; 50 frames the quarterly trend that institutions watch; 200 defines the secular regime and makes headlines when price crosses it. Running the default series through every window shows the smoothing ramp: the 5-period SMA reads 105.58, the 6-period 104.85, and stepping down to a 3-period lifts it to 107.22 as the old 101.20 close drops out of the math.

Shorter windows raise responsiveness at the cost of signal count. A 3-period average crosses price constantly; a 200-day average might cross twice a decade. The number of tradable signals per year scales roughly with 1/N, while the lag scales with N — so the choice is really a budget decision: how many trades do you want to consider, and how much give-back can you stomach on each? Write the answer down before touching the settings, because backtests make every window look brilliant in hindsight.

Whatever length you pick, keep it stable across your analysis. Switching from a 20 to a 50 mid-argument — because the longer line happens to sit where you want it — is curve-fitting your own narrative. The same discipline applies outside trading: smoothing a sales series with a 4-week window one month and a 13-week window the next makes every comparison apples-to-oranges, a trap the month over month calculator helps expose when the growth rate swings without the business changing.

Where Traders Get Moving Averages Wrong

The most common error is trusting an exponential average on a short series. Take a steady decline — 110.00, 108.50, 107.00, 105.20, 103.80, 102.40 — with a 5-period window: the SMA reads 105.38, the WMA 104.35, but the EMA prints 105.40, still above the SMA in a falling market. The seed (the 106.90 average of the older bars) dominates six observations; exponential memory needs roughly 3N points to fade. A trader reading that EMA as the fast line would think the decline is stalling when the weighting is simply stale.

The second error is treating any average-cross as self-validating because it worked on the S&P 500. Index averages embed survivorship and a century-long drift; a single-stock series carries bankruptcies, buyouts, and regime breaks that averages handle poorly. Signals should be tested on the instrument you actually trade, with the costs you actually pay. And a crossover strategy that rides winners still books its full share of losers — sizing the losses is what keeps an account alive, and the depth of your worst peak-to-trough decline matters more than the win rate of the crosses.

The third error is mechanical stacking: checking price above a 20-day, above a 50-day, and above a 200-day and counting three confirmations. They are one trend measured three times, correlated by construction — when all three flip against you, they flip together. Genuine confirmation comes from an independent dimension: volume, breadth, or volatility. Independent evidence is also the standard in fund evaluation, where a manager's edge is measured against benchmark tracking (see the information ratio calculator), not against a single lucky stretch.

Moving Averages Beyond Stock Charts

The same arithmetic runs operations dashboards, not just brokerage accounts. A distribution team smooths daily order counts with a 7-day moving average so a single promotional spike does not trigger a hiring panic; a web team runs a 28-day window over traffic so the weekly cycle stops distorting the trend line; an energy desk averages hourly load to set baseline procurement. In each case the N-period average plays the identical role — separating the level from the noise — and the same lag trade-offs apply.

The window choice follows cycles, in business as in markets. Daily data with a weekly cycle wants N = 7 or 14; weekly data with quarterly seasonality wants N = 13; anything misaligned lets the cycle leak into the smoothed line as a false wave. A 3-day average of retail sales prints weekend spikes; a 7-day average of the same series shows the true trend. When the smoothed trend itself becomes the deliverable — growth of the smoothed series — the right comparison runs through the CAGR calculator, which annualizes the compounded rate instead of averaging noisy period-over-period prints.

Averaging also disciplines forecasting. Averaging the last several periods is the simplest possible forecast baseline; anything more sophisticated has to beat it to justify its complexity, and most do not. Set expectations for what the average implies as a return assumption using the expected return calculator, then demand evidence before adding machinery. The moving average is the null hypothesis of forecasting: boring, transparent, and surprisingly hard to beat.

Pairing the Trend Filter With Risk Metrics

A moving average tells you the trend's direction; it says nothing about how much the position can hurt you. Position sizing and exit discipline do that work. Volatility decides how far a normal pullback extends — and drives portfolio swings that the stock beta calculator measures relative to the market, so a high-beta stock breaking its average usually travels much further than the index does before the trend resolves.

Regime filters built from averages also shape risk budgets directly. Under a golden-cross regime a plan might carry full exposure; under a death-cross regime it cuts position sizes and shortens stops. Whether that discipline actually adds value depends on the path of returns, which is why drawdown depth, not signal frequency, is the honest scorecard — the maximum drawdown calculator measures exactly the pain a regime switch tries to cap, and comparing that pain against the strategy's upside tells you if the filter earns its lag.

Finally, keep the trend line and the return math separate. A 20-period average rising tells you the recent past was positive; it does not tell you what you earned or will earn. Measuring realized performance needs the actual entry and exit prices, and measuring a manager needs attribution against a benchmark. Filters are for exposure decisions; arithmetic is for truth. Confusing the two is how a beautiful chart turns into a disappointing account statement.

FAQ

What is the difference between SMA and EMA?

The SMA weights every close in the window equally, so a 20-period SMA gives each bar 5% of the value. The EMA applies a smoothing factor k = 2/(N+1) to each new close and keeps the rest, so recent prices dominate: a 10-period EMA puts about 86.6% of its weight on the newest ten bars. The EMA reacts faster to turns, which also means it flips signals more often in choppy markets. On the default series here (window 5), the SMA reads 105.58 while the EMA reads 105.66 — a small gap on a gentle uptrend, but the gap widens sharply at turning points.

Can I calculate a 50-day SMA from only six prices?

No — six closes cannot reproduce a true 50-day average. This tool handles the mismatch honestly: it averages the newest closes you entered and labels the output as a partial series (6 of 50). For a rough sanity check that is fine, because a partial average of the most recent bars still tells you the short-term direction. For the actual 50-day line, pull the value straight from your charting platform, or enter your closes into a spreadsheet with =AVERAGE() over the full window.

What are the golden cross and death cross?

The golden cross fires when a shorter-term average climbs above a longer-term average — classically the 50-day crossing above the 200-day — and signals a shift to a bullish regime. The death cross is the reverse, marking a bearish regime. On the defaults here, the 5-period average of 105.58 sits 5.05% above the 100.50 long-term value, a golden-cross regime. These signals confirm trends that already happened; they arrive late by construction, since both averages trail price.

Is a moving average crossover a good buy signal on its own?

Rarely. Crossovers perform well in trending markets and bleed money in ranges, where price criss-crosses both lines repeatedly. Treat a cross as a regime filter — defining when to be long or flat — and let entry timing come from something faster, such as a pullback to the average or a breakout level. Risk controls matter more than the signal itself: know your exit before the next cross against you.

Why does the EMA equal the SMA when my window is 6 or larger on this tool?

The tool seeds the EMA with the SMA of the first N closes, the standard charting convention. With six entered prices and a window of six or more, every entered point goes into the seed and nothing remains for exponential weighting to act on, so the two values coincide and the explanation notes it. Enter a longer real series through the method on a spreadsheet or use the tool with a window below six to see the EMA pull away from the SMA.

Which window length should I use?

Common conventions: 9 or 10 for short-term swings, 20 (roughly a month of trading days) for intermediate trends, 50 for the quarterly trend, and 200 for the regime-defining long trend. Each period added smooths more and lags more — a 200-day SMA trails price by about 99.5 periods in a steady trend, versus 2 periods for a 5-day SMA. Match the window to how long you actually plan to hold, not to whichever setting produced the best backtest.

Related Calculators