|
The moving average is probably the most well-known analysis indicator used by traders. The basic purpose of the Moving Average is to eliminate the nose or insignificant fluctuations of the price, which interfere with the perception of trends.
A moving average is calculated for a certain period of time ranging from minutes to months, depending on the chart. There are three basic moving averages: Simple, Exponential and Weighted. The differences happen due to the weights each day’s price is given.
Simple moving average
Simple moving average is a simple summation of N number of days divided by N. It gives each price equal weight.

For better understanding moving average let’s look at an example of how to calculate simple moving average.
Example simple moving average.
The following prices are given for stock XYZ. Let’s calculate our simple moving average with a time period of 5 days.

First, we add the prices of days 1 through 5. And then we divide the total by 5.
11 + 11 ½ +12 + 12 ¼ + 13= 59 ¾ 59 ¾ / 5 = 11.95

11.95 is the average for the 5th day.
We then calculate the sixth day’s average. We use the same process as before but we add the prices of day 2 through 6 and then divide by 5. This process is repeated for the remaining days – 7, 8, 9, and 10.
Let’s take a look at the chart for the simple moving average we have just calculated. The moving average line is in red. We see that the moving average confirms our trend.
Because the price line is above the moving average line it is considered to be bullish. The drawback of the simple moving average is that in its calculation each day does not reflect changes in the movement of the trend at the time it occurs because it lacks behind.
Weighted Moving Average
The Weighted Moving Average gives each price a different weight relative to its position in time period. The Weighted Moving Average attempts to address this problem by increasing the weight of the time period sequentially. In other words the time period furthest from the present moment has the least weight and a time period nearest – the greatest weight. In other words, the most recent prices has the largest effect on the calculated value.
Now here is an example for the calculation of a weighted moving average.
As in our previous example we’ll use a five-day time period, for stock XYZ. You can see that the third line specified the weight of each day and that the nearest day, day 10, has the greatest weight.

In the fourth point the so-called weighted price listed, which is the product of the price and its weight. The calculation for the weighted moving average will be similar to that of the simple moving average with the exception of 2 points.
1). Instead of the prices the weighted prices are added together. 2). And the divisor is not the time period of 5, but rather the weights of the time period added together.
So, here is the calculation for day 5 (11+23+36+49+65)/(1+2+3+4+5)=12.27
and for day 6 (23+36+49+65+75)/(2+3+4+5+6)=12.40
And here are the values for the remaining days (7 through 10). 7- 12.27 8 – 12.40 9 – 12.74 10 – 13.06
And this is how the chart will look with our weighted moving average.

Exponential Moving Average
With the Exponential Moving Average a different type of weighting is used. The EMA takes into account not the price weight, but rather a percentage of the price.
Let’s assume we wanna to calculate a 10% EMA.
In this case we take 10% of the current day’s price and add it to 90% of the previous day’s EMA. You should notice where all the previously mentioned moving averages used the time period in our calculations the EMA uses an exponential percentage. Don’t be intimidated by these exponents, as they’re easily convertible to time periods.
A time period equals 2 divided by Exponential percent minus 1.
Time period = (2 / Exponential percent ) -1
To convert from a time period to exponential percent we do the following: 2 divided by time period plus 1. In order to convert the 10% EMA we just discussed into time periods we would do the following: 2 divided by time period plus 1.
Exponential percent = 2 / (Time period +1)
In order to convert the 10% EMA we just discussed into time periods we would do the following: 2 divided by 0.1 minus 1 equaling 19. Therefore the time period for the given moving average is equal to 19 days. (2/ 0.1) – 1 = 19
In the previous examples we calculated 5 day simple and weighted moving averages.
Now let’s see what exponential percentage of 5 day time period corresponds to: 2 divided by 5 plus 1 equaling 0.33. This gives us a 33% EMA. 2 / (5+1) = 0.33
Now, let’s apply what we’ve learned and calculate a 5 day 33% EMA given a following data. Here are the prices of XYZ stock.

Let’s take the amount given for day 5 in our SMA as the starting point for the calculations of the EMA. (11+11 ½ +12+12 ¼+13)/5=11.95
For 33 % exponential moving average we take 67% of the previous day’s EMA and add it to 33% of the current day’s price.
Now let’s calculate a 33% EMA for day 6. We take 67% from the previous day: 11.95 times 0.67 equaling 8.00 11.95*0.67=8.00 We take 33% of the day 6 price: 12 and a half times 0.33 equaling 4.13 12 ½ *0.33= 4.13 We add these two numbers: 8.00 plus 4.13 equaling 12.13. 8.00 + 4.13 = 12.13
12.13 is the 33% (5 day) EMA for Day 6.
We then repeat the calculations for day 7. 12.13 times 0.67 equaling 8.13. 12 and ¾ times 0.33 equaling 4.21. 8.13 plus 4.21 equaling 12.34.
After we do the calculations for the remaining days we get the following results.
5- 11.95 6 – 12.13 7 – 12.34 8 – 12.56 9 – 12.79 10 – 13.03
And here’s the chart.

We’ve learned the how to construct moving averages. It’s time to understand the purpose of these indicators.
Usually the price and its moving average are displayed on the same chart. The most traditional way of interpreting moving averages is as follows: Open a long position when the price line rises above the moving average. Open a short position or sell shares already owned, when the price crosses and falls below the moving average.

When using trading software for technical analysis you’ll see that the biggest challenge is not the calculations of moving averages because the compute des it in fraction of a second, but rather the chosen of the proper time period. Note that one time period might work for one security but not necessarily for another. Unfortunately there are no general recommendations concerning what time period should be used. In each specific case this period should be chose by trial-and-error. Modern programs have special utilities for the optimization of various parameters including time periods for moving averages.
|