Calculator · Technical Analysis

Moving average calculator

Paste a list of closing prices, oldest first, and choose a period. You get the latest simple and exponential moving average, the EMA weight k, and a row for each close from the first full period on.

Your numbers

Hypothetical closes. Separate with commas, spaces or new lines, without thousands separators.

Simple MA

–

Exponential MA

–

EMA weight k

–

Last close vs EMA

–

The working

    Simple and exponential averages from the same closes

    A simple moving average adds the last N closes and divides by N. Every close in the window counts the same. When a new close arrives the oldest one drops out, so the average can jump on a quiet day, purely because a large number left the window. An exponential moving average leans on recent closes. Each new value moves the prior EMA a fraction k of the way toward the latest close, with k = 2 / (N + 1). For a 10-period average that is 2 / 11, about 0.18, so the newest close carries about 18% of the weight and older closes fade without ever dropping out entirely.

    Why the seed matters

    An EMA needs somewhere to start. The usual choice is the simple average of the first N closes, and the exponential formula runs from the next close on. Platforms that seed differently, or that load years of history before the visible window, print slightly different values for the same period. The gap shrinks with every close, since the seed's weight falls by a factor of 1 minus k each step. A few cents of difference is normal.

    Reading the result

    A close above both averages says price has run ahead of its mean over the last N sessions, and that is all it says. Using moving averages treats the slope of a longer average as the trend filter and a shorter one as timing, and how to backtest a moving average strategy shows how to test a crossover by hand with closes like these. The exponential moving average entry takes the formula term by term. The golden cross and death cross apply the same arithmetic to 50 and 200 days.

    Questions about this calculator

    Why does my chart show a different EMA value?

    Most differences come from the starting point. An EMA keeps a little weight from every close since it began, so a platform that started the calculation months earlier, or seeded it with the very first close, lands on a slightly different number. Load more history into the list and the values move closer together.

    Which is better for swing trading, SMA or EMA?

    Neither is more accurate. The EMA reacts sooner to a turn, which suits timing an entry, and it also gives more false turns in a choppy range. The SMA is slower and steadier, which suits a trend filter. Run one of each and check that they agree.

    How many closes do I need?

    At least N for a single simple average. For an EMA close to what a chart prints, give it several times N, since the seed keeps some influence for a while. With exactly N closes the EMA and the SMA are the same number, because the EMA starts from the simple average.

    Other calculators