Although moving averages are an imprecise technical tool, they are effective in their ability to help define the environment that you are trading in. In their most common form, moving averages are just a simple average of a market’s closing prices for the last x number of periods. Those periods may be days, weeks, months or minutes. Their simplicity allows for considerable flexibility in their use and construction.
To calculate a 9 day moving average you merely add up the closing prices for the last 9 days and divide by the number of days. In this case the divisor would be 9. At the close of business on the 10th day, you would recalculate the average by dropping of the first day and adding the tenth to your calculation.
Assume that the following are the closing prices for the last 10 days of trading for the January Crude Oil:
|DAY 1||DAY 2||DAY 3||DAY 4||DAY 5||DAY 6||DAY 7||DAY 8||DAY 9||DAY 10|
Your calculation for a 9 day moving average would be:
(4892 + 4760 + 4741 + 4695 + 4620 + 4712 + 4638 + 4889 + 4864) / 9 = 4757 Yesterday
(4760 + 4741 + 4695 + 4620 + 4712 + 4638 + 4889 + 4864 + 4990) / 9 = 4768 Today
The moving average will always lag behind the market. As such, it makes for an excellent trend indicator. The market is in an uptrend when its last price is above the moving average and declining when the last price is below the moving average. You will lose some sensitivity if you use two moving average calculations such as a 9 & 18 day combination. Here, the uptrend is when the shorter, more sensitive moving average crosses over the longer average. The 9 & 18 day combination is the most common set of parameters for moving average analysis. The numbers are based on the assumption of 20 trading days in a month combined with the desire by traders to get a little advance warning ahead of everyone else. Hence, the 18 day value. The 9 day value is a harmonic of the larger 18 day value.
You can use these trend indications as a trading signal and go long the market when an uptrend is indicated and reverse when a downtrend materializes as the averages again cross each other. With this methodology you are always in the market. Although, this system does an excellent job of catching developing trends, it can devastate your account as the market consolidates or reverses its trend. You could find yourself trading rapidly for numerous small losses and giving back your trend profits through commissions and slippage. Another common usage is to use moving averages as a trend filter for your trades. Thus, if the moving average(s) indicate an uptrend is in progress you would take only the buy signals generated by your system or methodology. The reverse is true if the moving averages indicate a downtrend is taking place. Another application is trend confirmation for when the averages approach but do not cross each other.
There are also several different ways of calculating a moving average. The simple moving average discussed above weights all past data equally. There is a school of thought that believes that the more distant the price action the less relevant it is to the current market situation. For those situations we find a use for exponential and weighted moving averages. We will discuss those in another article.