Moving Average Calculator
Compute the simple moving average (SMA) sliding-window sequence for up to 6 price points at a chosen window length.
Input Data
Results
At a glance:A simple moving average (SMA) is the mean of a sliding window of n prices. Each step drops the oldest price and adds the newest, so the average moves with the data. With length n and prices p1..pk, the count of averages is max(0, k − n + 1).
Formula
For each window of n prices: average = sum of the n prices ÷ n.
Slide the window by one price each step.
Average count = number of prices − window length + 1 (if positive).
$$MA[k] = \dfrac{1}{n}\sum_{i=0}^{n-1} P_{k+i}$$$$\text{count} = N - n + 1$$How to Use
- Enter the window length n.
- Enter up to 6 prices oldest to newest (0 for unused).
- Read the latest average, first average and the count.
FAQ
What is a moving average for?
A moving average smooths out short-term noise so the trend stands out. It is often used as a dynamic support/resistance line — when the price crosses the average, it is frequently read as a signal that the trend may be changing.
How long a window should I pick?
A shorter window reacts faster to recent prices but is noisier; a longer window is smoother but lags more. Common choices are 10-day, 50-day and 200-day, depending on whether you watch short-term or long-term trends.
Is this a simple or exponential moving average?
This calculator uses the simple moving average (SMA), giving equal weight to every price in the window. The exponential moving average (EMA) weights recent prices more heavily and is not supported here.
What are the golden cross and death cross, and how does the average generate buy/sell signals?
The golden cross and death cross are the most famous uses of moving averages, both relying on 'two averages of different lengths crossing each other' to judge a trend change. The idea: plot a 'short-term average' (fast, e.g. 50-day) and a 'long-term average' (steadier, e.g. 200-day) together. The short one tracks recent prices and moves quickly; the long one represents the long-term trend and moves slowly. When they cross, it is often read as a possible trend turn. Golden cross: the short-term average crosses 'upward' through the long-term average, meaning recent momentum is strengthening and rising above the long-term mean — often seen as a bullish signal, a reference for some to consider buying. Death cross: the opposite — the short-term average crosses 'downward' through the long-term average, meaning momentum is weakening, often seen as bearish. Beyond the pair, a single average also generates signals: e.g. price rising through the average is read as strengthening, price falling below it as weakening; the line itself is often treated as dynamic support/resistance. But understand the limits: (1) a moving average is a lagging indicator, computed from past prices, so cross signals often appear only after the trend has run a while; (2) in a sideways, choppy market, prices repeatedly cross the line, producing many false signals; (3) the window length chosen greatly affects signal frequency and reliability; (4) do not rely on it alone — combine with volume, other indicators and the broader trend. Use the average as an aid to read trend direction and rough support/resistance, with strict stop-loss and position sizing. Moving averages are not guaranteed; investing carries loss risk, and this tool is for educational reference only, not investment advice.
SMA or EMA — which should I use?
Both smooth prices to reveal trends; the core difference is 'how they weight prices inside the window', which changes their speed and character. SMA (used here) treats 'all prices in the window equally' — e.g. a 5-day SMA is the last five closes averaged, each weighted 1/5 regardless of age. Its strengths are intuitive, stable, and not easily distorted by a single odd price; its weakness is slower reaction, because old and recent prices weigh the same, so it lags when a turn begins. EMA gives 'more weight to recent prices', with older prices decaying exponentially, so it reacts faster to the latest changes and catches turns earlier, but is also more prone to whipsaw from short-term noise. Which to use depends on you: (1) for long-term trends and stability, or long cycles (e.g. 200-day), SMA is usually enough; (2) for short-term trading needing early detection, EMA fits better; (3) many use both — EMA for timing, SMA for confirming the big trend. Both are lagging indicators that reflect the past, not predict it; in choppy markets both give false signals, and the window choice (10/50/200) often matters more than SMA vs EMA. This tool provides SMA (equal weight); combine with trend judgement, other indicators and risk management. Investing carries loss risk; this tool is for educational reference only, not investment advice.
Related Tools
References
Content review: Calculatorism Finance Team. Results are for reference only; please refer to the relevant authorities for the official figures.