Technical indicator

Moving Averages

A moving average smooths the price series by averaging closing prices over a sliding window. It is the most widely used technical indicator and the building block of many others, including Bollinger Bands, Envelopes, MACD and the stochastic oscillators.

Type
Trend-following
Typical parameters
n = 10, 20, 50 or 200 days
Main signal
Price or a shorter MA crosses above (buy) or below (sell) the moving average

What a moving average shows

A moving average shows the average price of a security over the last n periods. Because it lags the price, it filters out day-to-day noise and makes the direction of the trend easier to see: a rising average indicates an uptrend, a falling average a downtrend. Traders compare the average with the price itself, or compare two averages of different lengths.

The common types are the simple (SMA), exponential (EMA), weighted, triangular and variable moving averages. They differ in how much weight recent prices receive: the SMA weights every day equally, while the EMA reacts faster because it gives the newest prices more weight.

Calculation

The simple moving average of the closing price over n days:

SMAt=1n∑j=t−n+1tCj

The exponential moving average is calculated recursively, starting from an SMA for the first value:

EMAt=α·Ct+(1−α)·EMAt−1,α=2n+1

where n is the number of days and Cj is the closing price on day j.

Trading signals

  • Price crossover: a buy signal when the price closes above the moving average, a sell signal when it closes below.
  • Two-average crossover: a buy signal when a shorter average crosses above a longer one (for example 50-day above 200-day, the “golden cross”), a sell signal on the opposite crossing.
  • Slope: the direction of the average confirms the trend; many traders only take buy signals while the average is rising.

Moving averages work well in trending markets and give frequent false signals when prices move sideways. The Moving Average Oscillator plots the difference between two averages so crossings are easier to see.

Technical indicators describe past prices and do not guarantee future results. Combine several indicators and test a strategy on historical data before trading it. See our disclaimer.