Moving averages are trend indicators and are frequently used due to their simplicity and effectiveness. Before we learn moving averages, let us have a quick recap on how averages are calculated.
Assume 5 people are sitting on a nice sunny beach enjoying a nice chilled bottled beverage. The sun is so bright and nice that each one of them end up drinking several bottles of the beverage. Assume the final count to be something like this:
Sl No | Person | No of Bottles |
---|---|---|
01 | A | 07 |
02 | B | 05 |
03 | C | 06 |
04 | D | 03 |
05 | E | 08 |
Total # of bottles consumed | 29 |
Assume a 6th person walks in to find out 29 bottles of beverages lying around them. He can quickly get a sense of ‘roughly’ how many bottles each of them consumed by dividing [the total number of bottles] by[total number of people].
In this case it would be:
=29/5
=5.8 bottles per head.
=5.8 bottles per head.
So, the average in this case tells us roughly how many bottles each person had consumed. Obviously there would be few of them who had consumed above and below the average. For example, Person E drank 8 bottles of beverage, which is way above the average of 5.8 bottles. Likewise, person D drank just 3 bottles of beverage, which is way below the average of 5.8 bottles. Therefore average is just an estimate and one cannot expect it to be accurate.
Extending the concept to stocks, here are the closing prices of ITC Limited for the last 5 trading sessions. The last 5 day average close would be calculated as follows:
Date | Closing Price |
---|---|
14/07/14 | 344.95 |
15/07/14 | 342.35 |
16/07/14 | 344.20 |
17/07/14 | 344.25 |
18/07/14 | 344.0 |
Total | 1719.75 |
= 1719.75 / 5
= 343.95
= 343.95
Hence the average closing price of ITC over the last 5 trading sessions is 343.95.
The ‘moving’ average (also called the simple moving average)
Consider a situation where you want to calculate the average closing price of Marico Limited for the latest5 days. The data is as follows:
Date | Closing Price |
---|---|
21/07/14 | 239.2 |
22/07/14 | 240.6 |
23/07/14 | 241.8 |
24/07/14 | 242.8 |
25/07/14 | 247.9 |
Total | 1212.3 |
= 1212.3/ 5
= 242.5
= 242.5
Hence the average closing price of Marico over the last 5 trading sessions is 242.5
Moving forward, the next day i.e 28th July (26th and 27th were Saturday and Sunday respectively) we have a new data point. This implies now the ‘new’ latest 5 days would be 22nd, 23rd, 24th, 25th and 28th. We will drop the data point belonging to the 21st as our objective is to calculate the latest 5 day average.
Date | Closing Price |
---|---|
22/07/14 | 240.6 |
23/07/14 | 241.8 |
24/07/14 | 242.8 |
25/07/14 | 247.9 |
28/07/14 | 250.2 |
Total | 1223.3 |
= 1223.3/ 5
= 244.66
= 244.66
Hence the average closing price of Marico over the last 5 trading sessions is 244.66
As you can see, we have included the latest data (28th July), and discarded the oldest data (21st July) to calculate the 5 day average. On 29th, we would include 29th data and exclude 22nd data, on 30th we would include 30th data point but eliminate 23rd data, so on and so forth.
So essentially, we are moving to the latest data point and discarding the oldest to calculate the latest 5 day average. Hence the name “moving” average!
In the above example, the calculation of moving average is based on the closing prices. Sometimes, moving averages are also calculated using other parameters such as high, low, and open. However the closing prices are used mostly by the traders and investors as it reflects the price at which the market finally settles down.
Moving averages can be calculated for any time frame, from minutes, hours to years. Any time frame can be selected from the charting software based of your requirements.
For those of you familiar with excel, here is a screenshot of how moving averages are calculated on MS Excel. Notice how the cell reference moves in the average formula, eliminating the oldest to include the latest data points.
Cell Ref | Date | Close Price | 5 Day Average | Average Formula |
---|---|---|---|---|
D3 | 1-Jan-14 | 1287.7 | ||
D4 | 2-Jan-14 | 1279.25 | ||
D5 | 3-Jan-14 | 1258.95 | ||
D6 | 6-Jan-14 | 1249.7 | ||
D7 | 7-Jan-14 | 1242.4 | ||
D8 | 8-Jan-14 | 1268.75 | 1263.6 | =AVERAGE(D3:D7) |
D9 | 9-Jan-14 | 1231.2 | 1259.81 | =AVERAGE(D4:D8) |
D10 | 10-Jan-14 | 1201.75 | 1250.2 | =AVERAGE(D5:D9) |
D11 | 13-Jan-14 | 1159.2 | 1238.76 | =AVERAGE(D6:D10) |
D12 | 14-Jan-14 | 1157.25 | 1220.66 | =AVERAGE(D7:D11) |
D13 | 15-Jan-14 | 1141.35 | 1203.63 | =AVERAGE(D8:D12) |
D14 | 16-Jan-14 | 1152.5 | 1178.15 | =AVERAGE(D9:D13) |
D15 | 17-Jan-14 | 1139.6 | 1162.41 | =AVERAGE(D10:D14) |
D16 | 20-Jan-14 | 1140.6 | 1149.98 | =AVERAGE(D11:D15) |
D17 | 21-Jan-14 | 1166.35 | 1146.26 | =AVERAGE(D12:D16) |
D18 | 22-Jan-14 | 1165.4 | 1148.08 | =AVERAGE(D13:D17) |
D19 | 23-Jan-14 | 1168.25 | 1152.89 | =AVERAGE(D14:D18) |
As it is evident, the moving average changes as and when the closing price changes. A moving average as calculated above is called a ‘Simple Moving Average’ (SMA). Since we are calculating it as per the latest 5 days of data it is called referred to as 5 Day SMA.
The averages for the 5 day (or it could be anything like 5, 10, 50, 100, 200 days) are then joined to form a smooth curving line known as the moving average line, and it continues to move as the time progresses.
In the chart shown below, I have overlaid a 5 day SMA over ACC’s candlestick graph.
So what does a moving average indicate and how does one use it? Well, there are many applications of moving average and shortly I will introduce a simple trading system based on moving averages. But before that, let us learn about the Exponential Moving Average.
No comments:
Post a Comment