Moving averages in stock market has been one of the most widely used tools in technical analysis. In this chapter we will learn how to calculate moving averages.
Moving Averages are just based on the simple principle of Averages that we learnt in our school times.
A moving average in a simple language can be defined as the average price of a stock price at a given time. When we calculate a moving average we have to know the time span for which we are calculating the average price (for e.g., 25 days).
To calculate a “simple” moving average we have to add the closing prices of the stock for the “n” time periods and then we have to divide the sum by “n”. For example, to calculate a simple moving average price of a stock for 25 days, we have to add the closing prices of a stock for most recent 25 days and then divide the sum by 25. The result obtained is the simple moving average price of the stock for the last 25 days. This calculation can be done by choosing any number of time periods in the chart.
Note :To calculate moving average we need to have “n” time periods of data. For example, to calculate a 25-day moving average we have to take 25th day into consideration without which we cannot display 25-day moving average.
For example, to calculate Moving Average Price of Stock for last 10 days we cannot display a 10-day moving average until the 10th day in a chart.
Let’s take an example of Stock SBI and calculate its 10-day Moving Average.
Note : To get price of a stock for any number of days, you can get this data from Historical Data of any stock from NSE website. The snapshot below shows where to click to get the historical data.
Below snapshot gives the closing prices of SBI for last 10 days :
10-day Moving Average price of SBI :
= [Total sum of all closing prices of SBI / 10 days]
= [251.2+258.05+258.3+255.9+256.4+251+251.15+251.7+248.9+246.7] / 10 days
= 2529.3 / 10 Days
Therefore, 10-day Moving Average Price of SBI is 252.9 /-
Therefore, if Current Market Price is below 252.9 then it gives a Sell signal and if price is above 252.9 then it gives a Buy Signal.
Types of Moving Averages :
Moving averages are of different types and they differ based on the way they are calculated however the meaning remains same irrespective of the different methods used for calculation.
The two most common types of moving averages are
- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
Simple Moving Average (SMA)
Simple Moving Average is one of the most common easy method used to calculate the moving average of stock prices. In this we simply add all the past closing prices over a fixed time period and then we divide the sum by the number of period used in the calculation. For example, to calculate 30-day moving average, the last 30 closing prices of the stock are added together and then divided by 30. Take a look at below formula to calculate Simple moving average of any stock.
SMA [n] = where n = No. of Days.
For example, SMA of SBI for 10 days moving average is :
SMA = 252.9
Now to calculate Simple Moving Average (SMA) manually can be a very tedious task, for this reason lot of charting softwares have been developed which shows SMA for any number of days.
Below snapshot shows SMA  in red and SMA  in blue for SBI :However there is one limitation while calculating simple moving average. Many people argue that the most recent closing prices should be given more weight-age as compared to giving equal to weightage to all closing prices of the stock. This argument led to invention of a new moving average calculation called Exponential Moving Average.
Exponential Moving Average (EMA)
In Exponential Moving Average higher weightage is given to most recent data points and thus it is considered more efficient than the simple moving average which calculate average on linear basis.
To calculate Exponential Moving Average many charting softwares have been developed which can do calculation for you.
Your attention please: The most important thing to remember about the exponential moving average is that it is more sensitive to new information as compared to the simple moving average. This is the reason why all technical traders go for EMA instead of SMA. As we can see in below figure, a 100-period EMA rises and falls faster than a 100-period SMA. This minor difference doesn’t seem like much, but it can affect your returns.
Below is the chart which shows SMA and EMA for 100 days of Stock SBI :
Though both SMA and EMA are for a 100 day period, we can see in above figure that EMA is more responsive to the prices and hence it is more accurate.
Moving average is mostly used to identify the trend in the market that is whether the stock is in downtrend or uptrend, it also allows to find the support and resistance levels of any stock.
As we can see in below chart, for the stock Tata Motors taking its 200-day SMA, when the price is above moving average, the stock is in uptrend. Whereas, when the price is below moving average the stock is in downtrend.
In next chapter we will learn about the Indicators used in Technical Analysis.