Moving Averages Formula

A moving average is a smoothing technique used to isolate the trend from short term price fluctuations. There are four basic types of moving averages: simple, auto-regressive, linear weighted, and exponential. The types differ primarily in how they treat older data:

 

Simple Moving Average

A simple moving average is a form of averaging in which all prices are given the same weight. It is calculated by starting with the oldest period specified and adding up specified prices (open, close, high, low, or volume) for the number of periods specified. The sum is then divided by the number of periods you specify in the Chart Settings window.

 

MAt = Moving Average

Pt = Selected calculation price

Pt-1 = Selected calculation price 1 period ago

Pt-n = Selected calculation price n periods ago

n = Number of bars (periods)

Linear-Weighted Moving Average

A linear-weighted moving average applies equal weight to all prices. The closing price is summed over n periods and divided by the total number of periods (n).

Exponential Moving Average

A form of weighted averaging in which all prices have influence on the average but with decreasing weight placed upon older prices. It is held widely that this form of a moving average is a better reflection of a stock's performance.

EMAt = EMAt-1 + Sf (Pt-EMAt-1)

EMAt = Exponential moving average

EMAt-1 = Previous moving average value

Sf = Smoothing factor computed as 2/(n+1) where n = number of days in a standard moving average

For a table of smoothing factors, please see Smoothing Factors.

 

Source: The Encyclopedia of Technical Market Indicators, Colby and Meyers