- 1). Determine the time frame and number of periods for which you want to calculate a moving average. You can select any number of periods; a moving average with a lower number of periods is more influenced by recent prices than one with a higher number. For the following example, calculate a five-period moving average on a daily time frame.
- 2). Determine the closing prices of the most recent number of periods for which you want to calculate the moving average. Exclude the current period because it has yet to close. For the following example, use $12, $13, $12, $14 and $15 in order from oldest to most recent for the five most recent daily closing prices of a stock.
- 3). Calculate the sum of the closing prices. In the example, calculate the sum of $12, $13, $12, $14 and $15, which equals $66.
- 4). Divide the result by the number of periods of the moving average. In the example, divide $66 by 5, which equals $13.20. This is the moving average for the current period, which shows the average closing price for the five most recent daily periods.
- 5). Determine the closing price of the current period after the current period closes. In the example, use $15.50 for the closing price of the current daily period. This becomes the most recent daily closing price.
- 6). Calculate the sum of the closing prices of the most recent number of periods of the moving average. Use the closing price from Step 5 as the most recent period and eliminate the oldest closing price in Step 2. In the example, eliminate $12 as the oldest closing price and calculate the sum of the closing prices of the five most recent periods, which are $13, $12, $14, $15 and $15.50. This equals $69.50.
- 7). Divide your result by the number of periods of the moving average. In the example, divide $69.50 by 5, which equals $13.90. This is the new moving average for the current period after the previous period ended. Repeat Steps 5 through 7 for each new period as each current period closes.
previous post
next post