What is a Moving Average
Moving averages are a standard tool for determining trends. Simply put, they take the average of consistent values (high, low, close, etc.) over a predetermined time. The most common value used to calculate a moving average is the close. Generally, the close is accepted as the “true” price for the observed period. The two main ways to calculate moving averages for trading and trend analysis are simple (SMA or MA) and exponential (EMA).
Simple is calculated as a standard arithmetic mean, with all the values added and then divided by the number of values. This method of calculation suffers from something called the dropoff effect. This effect is when a large value is dropped from the average calculation, producing a significant shift in the average value.
Exponential moving averages are calculated in a manner that avoids the dropoff effect. EMA’s are calculated by weighting the previous EMA value against the new value that is added. To calculate the weight of the new EMA value, we use the smoothing factor divided by one plus the number of periods. The most common smoothing factor is two and is what I will use for the example:
Weight = 2 / (# of periods + 1).
Thus, the formula for the new EMA value is:
EMA = Previous EMA * (1 - Weight) + Current Value * Weight
This method of calculating the moving average takes all past values into account.
Below is a chart showing an EMA and SMA of the same period. As you can see, they are close, but there are some notable differences. The EMA tends to follow the price action more closely.
How Moving Averages are Used
Moving averages are generally used by combining two moving averages of different lengths to get trading signals. A standard signal is to buy when the fast (short length) moving average crosses over the slow (longer length) moving average and go short when the fast crosses under the slow.
Another use of the moving average is as a trailing stop loss. For example, when you enter long into a position, you maintain the position until the price touches or closes below a predetermined moving average. You would exit the position for shorts when the price touches or closes above the moving average.
Limits of Moving Averages
Moving averages are a lagging indicator. They are calculated using historic price information and do not have a predicitve component to their equation. They also struggle to accurately display the trend in a sideways or consoladating market. As with any indicator or financial analysis tool, they should not be used in isolation.