A simple moving average (MA) is the unweighted mean of the previous n data points. For example, a 10-day moving average of closing price is the mean of the previous 10 days’ closing prices. If those prices are p1 to pn then the formula is
When calculating successive values, a new value comes into the sum and an old value drops out, meaning a full summation each time is unnecessary.
In technical analysis there are various popular values for n, like 10 days, 40 days, or 200 days. The period selected depends on the kind of movement one is concentrating on, such as short, intermediate, or long term. In any case, moving average levels are interpreted as support in a rising market, or resistance in a falling market.
In all cases, a moving average lags behind the latest price action, simply from the nature of its smoothing. A Moving Average can lag to an undesirable extent, and can be influenced too much by old prices dropping out of the average. This is addressed by giving extra weight to recent prices, as in the Weighted Moving Average and Exponential Moving Average.
One characteristic of the Moving Average is that if the data has a periodic fluctuation, then applying a MA of that period will eliminate that variation (the average always containing one complete cycle). But a perfectly regular cycle is rarely encountered in economics or finance.
Note: Interactive Chart users have the option of identifying what data point to calculate the Moving Average from: the Open, High, Low, or Close. You also can identify a “shift” parameter.
Period (20) – the number of bars, or interval, used to calculate the moving average.
Source (Close) – For Interactive Charts only, the data point on which to calculate the Moving Average: Open, High, Low, or Close.
Shift (0) – the number of bars to displace the moving average.