Technical Analysis: Understanding Moving Averages

Gautam Upadhyaya

25 Jul 2017

Untitled Document

Moving averages

Moving average is a widely used technical indicator of stock prices that helps to smooth out the volatility in the price action by filtering out the noise from random price fluctuations. A moving average is a trend-follow lagging indicator as it is calculated taking past data into consideration.  As its name suggests, a moving average is an average that moves as old values are dropped out as new values become available. Moving averages can be employed to identify the current trend in a script.

Types of moving averages

There are 3 types of moving averages

a) Simple moving average (SMA)

It is obtained by computing the simple average of price data over a defined period of time. In general, we compute the simple moving average based on the closing price of the security as it is considered to have more significance as compared to the rest of price points (Namely open/high/low price for the day). Thus, a 5-day SMA is calculated by adding the closing price of 5 days and dividing this sum by the total number of days (in this case, five).

For example, the 5 days SMA of ITC is calculated as follows:

While calculating the Moving Average after the close of the trading session on July 7, 2017, we can compute the SMA value by taking the closing price of the last 5 trading session, including July 7, 2017, and dividing the same by 5. At close of the next trading session on July 10, 2017, SMA is calculated by excluding the Closing Price of July 3, 2017 by adding the new data point. (Closing Price of July 10, 2017).

As illustrated in the example below, prices gradually decreases from 342.5 to 328.85 over a period of eight days in the same timeframe the 5 Period SMA decreases from 336.44 to 332.79, indicating a lag associated with the Moving Averages. Hence, larger the time period, larger is the lag.

Date

Close Price

5 Period SMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

10-Jul-17

333.30

334.60

11-Jul-17

330.40

333.23

12-Jul-17

328.85

332.89

7TH July SMA = 336.44= (342.50+337.25+331.05+337.10+334.30)
                                                                          5 

10th July SMA =334.6=        (337.25+331.05+337.10+334.30+333.30)
                                                                          5         
11th July SMA= 333.23=   (331.05+337.10+334.30+333.30+330.40)
                                                                          5
12th July WMA= 332.89=    (337.10+334.30+333.30+330.40+328.85)
                                                                          5

b) Weighted moving average (WMA)
Weighted moving average moves a step ahead from simple moving average. Here, we assign a weight to each value, with a bigger weight assigned to the most recent data points as they are more relevant than historical data points. The sum of weights should add up to 1 (or 100%). As new data points are added, the new weights will align accordingly. In contrast, in simple moving average, each value is assigned the same weight. Ideally, traders calculate WMA on the basis of closing price.

The weighted moving average is calculated by multiplying the given price by its assigned weight and then dividing the sum by total number of days. The weights assigned are subjective in nature, and it is based on the discretion of the trader. Because of its calculation methodology, WMA will follow prices more closely than a corresponding SMA. The WMA reduces the lag effect to an extent.


Date

Close Price

Weights

WMA

03-Jul-17

342.5

0.07

04-Jul-17

337.25

0.13

05-Jul-17

331.05

0.20

06-Jul-17

337.10

0.27

07-Jul-17

334.30

0.33

335.34

10-Jul-17

333.30

334.29

11-Jul-17

330.40

332.89

12-Jul-17

328.85

331.43

 

7TH July WMA = 335.34= (342.50*0.07+337.25*0.13+331.05*0.20+337.10*0.27+334.3*0.33)
                                                 5

10th July WMA =334.29=        (337.25*0.07+331.05*0.13+337.10*0.20+334.3*0.27+333.3*0.33)
                                                 5
11th July WMA= 332.89=   (331.05*0.07+337.10*0.13+334.30*0.20+333.3*0.27+330.4*0.33)
                                                 5
12th July WMA= 331.43=    (337.1*0.07+334.30*0.13+333.30*0.20+330.4*0.27+328.85*0.33)
                                                 5

C) Exponential moving average (EMA)
Exponential moving average differs from the simple and weighted moving average as an EMA is calculated by taking all the historical data points since the inception of the stock. Ideally, to calculate 100% accurate EMA, we should make use of all the closing prices right from the time of the listing of stock.

Calculation of the EMA is a 3 step process

Step 1: Since it is not practical to calculate historical data right from the inception of the stock, we use the SMA value as the initial EMA value. So, a simple moving average is used as the previous period's EMA in the first calculation.
Step 2: We calculate the weighting multiplier by dividing 2 by the sum of total periods and 1.
Step 3:  We subtract the EMA of the previous day from the current closing price, and multiply this number by the multiplier. We then add this product with its previous period EMA to find out the final EMA value.

Therefore, the current EMA value will change depending on how much past data we use in our EMA calculation. The more data points we use, the more accurate our EMA will be. The goal is to maximize accuracy while minimizing calculation time.

Initial EMA value = 5-period SMA

Weighting Multiplier= (2 / (Time periods + 1)) = (2 / (5 + 1) ) = 0.3333 (33.33%)

EMA= {Close – EMA of previous day} x multiplier + EMA (previous day).

A 5-period EMA applies a 33.33% weighting to the most recent prices. A 10-period EMA has a weighting multiplier of 18.18%. The shorter the time period, larger the weighting multiplier will be. We notice that as the time period doubles, the weighting multiplier drops ~50%.

Date

Close Price

5 Period SMA

Weighting factor

5 Period EMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

336.44

10-Jul-17

333.30

334.60

0.3333

335.39

11-Jul-17

330.40

333.23

0.3333

333.73

12-Jul-17

328.85

332.79

0.3333

332.10

7TH July EMA = 5 Period SMA= 336.44
10THJuly EMA = 335.39= (333.30-336.44) x0.33 + 336.44
11THJuly EMA = 333.73= (330.40-335.39) x0.33 + 335.39
12THJuly EMA =332.10= (328.85 -333.72) x0.33 +333.72

Comparison of the 3 moving averages
As we see by comparing the computation methodology of the 3 moving averages, different values are generated. EMA is most commonly used by traders.

Moving Averages

SMA

WMA

EMA

Advantages

1)Smoothened Average
2)Less prone to whipsaw
3)Best average to consider for support & resistance

1)Reduction in price lag, so can be implemented for short term trading 

1)Reduction in price lag, hence can be used for short term trading
2)No omission in price data points

Disadvantages

1)Has  maximum price lag
2) Assigns same weight to all price data.
3)Omission of previous data points leading to all price data not made use of

1) Omission of previous data points leading to all price data not made use of
2) Chance of whipsaw

1)Chance of  whipsaw

Moving Average Value comparison – The following table represents a comparison between the different values of the 3 types of Moving Averages over the same period of time

Date

Close Price

 5 Period SMA

5 Period WMA

5 Period EMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

335.34

336.44

10-Jul-17

333.30

334.60

334.29

335.39

11-Jul-17

330.40

333.23

332.89

333.73

12-Jul-17

328.85

332.89

331.43

332.10

Graphical comparison on the 3 moving averages.

(Blue-5 Period EMA, Green-5 Period WMA, Pink-5 Period SMA)

As we seen in the above graph, when there is a sharp correction in price as in the case of ITC, EMA and WMA reacted  the most since they are assigned a higher weight to the most recent prices as compared to the SMA.

Applications of moving average

Trend Identification

Traders use moving averages to identify the trend in a stock. A rising 200day moving average reflects that the long term trend is up and stock can be traded with a positive bias. Similarly, a falling 200day moving average reflects a long term downtrend and hence we can consider shorting the stock or refraining from investing in it.

(Blue-10 Period EMA, Green -89 Period EMA, Pink 200 Period EMA)

From the above graph, we can clearly see that L&T Fin is in a long term uptrend, the short term and medium term averages are trading above its long term, 200day moving average which is also showing an upward momentum. A price dip towards its medium term average can be considered as a buying opportunity.

Buy/Sell signals based on crossover

A buy signal is generated when a bullish crossover occurs i.e. the short term moving average crosses the long term moving average, popularly referred to as a golden cross. For example, when the 89day EMA crosses above the 200day EMA, a bullish trade can be initiated. On the other hand, a bearish dead cross occurs when the short term moving average crosses below the long term moving average.   The signals generated tend to occur with a lag as we make use of 2 lagging indicators. The best trading opportunities are obtained in a trending market as compared to the sideways market wherein whipsaws or false signals are generated.

Price

89 Period EMA

Action /View

Technical Term

Trading Above 200EMA

Crosses above  200EMA

Bullish

Golden cross

Trading Below 200EMA

Crosses below   200EMA

Bearish

Dead cross

From the above graph we see how moving averages can be used to generate trading signals

 

Moving averages can also be used to generate signals with simple price crossovers. A bullish signal is generated when prices move above the moving average. A bearish signal is generated when prices move below the moving average. Advantage of price signals is that the time lag is reduced and traders are able to react at an early stage.

As in the Fortis Ltd case shown above, traders could have initiated a short position or could have closed their long positions when the stock price closed below its 200day EMA. Consequently, a huge surge in trading volumes with MACD Histogram getting into the negative territory indicated a change in momentum which gave added information to traders to take a bearish view, resulting in a fall in stock price by 18%.

Support & Resistance Levels

Moving averages also tend to act as support and resistance levels. A stock in a long term uptrend could find support near its medium term EMA during a pullback, similarly a stock in a long term downtrend could face resistance near is medium term moving average during any bounce back. In fact, some moving averages may offer support or resistance simply because it is widely used by many traders. As an example, a trader may not short a stock if it is trading near its 200day EMA because of the fear that other traders may be using it as a buying zone.

In the above example of JSW Steel, we see how the stock has taken support along its medium term 89day EMA on multiple occasions and has acted as a good support level to purchase the stock.

Moving Averages in sync with Candlestick pattern

Moving averages can also be traded in tandem with candlestick patterns. In the above chart of Bata India Ltd, the bullish candlestick pattern can be traded with added confidence as it coincides with the support of 200day EMA.

Moving Average in sync with Price pattern

In the above chart of United Spirits Ltd, the buy signal generated by the bullish crossover coincides with a cup and handle breakout on the daily chart, affirming a bullish bias in the stock.

Construction of Indicators

Moving averages are used in the construction of technical indicators such as Bollinger Band and MACD which are widely used by market technicians. 

Key moving averages used by technical analyst

Moving averages are used based on trading horizon.

Moving Average

Trading Time frame

5 period MA

Short term

13 period MA

Short term

50 period MA

Medium Term

89period MA

Medium Term

200 period MA

Long Term

Observations on Moving Average

  • It is used in a trending market to give clear trend direction by eliminating the noise.
  • In case of a sideways market, moving average would lead to whipsaws making the use of other indicators like RSI and Stochastic more helpful.
  • Signals generated by moving averages tend to have a lag.
  • It is used best when combined with technical indicators and price patterns.

Have Referral Code?

Similar articles

  • Responses
  • Patidar Samaj

    - 2 hrs ago

    This article claims RJio was given a "Backdoor Entry" into the 4G Based Voice Routing. The peculiar aspect is without the Voice License, Rjio would have been a mere ISP. With the license, it is now a holistic communications service provider, with ability to exponentially scale the bouquet of products. The events indicate it was meticulously planned way before the auctions because the auctions were clear on the agenda: 4G for internet only.

Load More
mutual-fund

Why to Choose Mutual Funds Instead of Directly Investing Into Equities?

Whether to invest in equities or mutual funds is a question that has plagued every investor. As someone who needs the best value for his/her investment should you invest in equity directly or via mutual funds?

Let’s start by first understanding what these two terms ‘equities’ and ‘mutual funds’ stand for-

Equities- Equities generally represent ownership of a company. If you own any equity in a company, you are a part owner of the said company (depending on how much equity you own).

Mutual Funds – It is an investment scheme which is professionally managed by an asset management company. It pools together the resources of a group of people and invests their money in equities, debentures, bonds and other securities.

Why choose mutual funds over equities?

For people who’ve never invested in either stocks or mutual funds, it is hard to know which is better and where to start. Broadly speaking, if you are a novice investor, mutual funds are not only less risky but also way easier to manage. Here are some ways in which investing in mutual funds is beneficial as opposed to investing in equities -

Diversification

Mutual funds provide more diversification as compared to an individual equity stock. When you invest in equity, you are investing in a single company which has its inherent risk. For example, if you invest Rs.20,000 in buying equities of one company, you could face a total loss if that particular company performs poorly in the market.  

If you invest the same amount in mutual funds, it will be invested in different kinds of stocks and financial instruments, high-risk and low-risk both, so you might not face total loss even if one company does poorly.

Scale of Investment and Lower Costs

For an individual investor buying and selling stocks is a difficult task due to its high price. Thus, any gains made from stock appreciation are nullified if the overall trading costs are considered. Comparatively with mutual funds, as the money is pooled from a large number of investors, the cost per individual is lowered.  

Another advantage of mutual funds is that you don’t need to invest large sums of money. Buying equities for a profitable venture needs huge amounts of money, a minimum of few lakhs. With mutual funds, you can start with Rs.1000 and earn profits on that as well.

Convenience

Keeping an eye on the markets everyday is a time-consuming business, especially if you are investing as a side gig. There are people who spend their lives studying the market and still end up sustaining heavy losses. Though investing in mutual funds does not guarantee high returns, it is stress-free and needs less work as compared to investing in equities.

To sum it up

It is important to remember that mutual funds have their own disadvantages as well. Thus, as with any financial decision, educating yourself and understanding the suitability of all the available options is the ideal way to invest. 


Banner

Technical Analysis: Understanding Moving Averages

Gautam Upadhyaya

25 Jul 2017

Untitled Document

Moving averages

Moving average is a widely used technical indicator of stock prices that helps to smooth out the volatility in the price action by filtering out the noise from random price fluctuations. A moving average is a trend-follow lagging indicator as it is calculated taking past data into consideration.  As its name suggests, a moving average is an average that moves as old values are dropped out as new values become available. Moving averages can be employed to identify the current trend in a script.

Types of moving averages

There are 3 types of moving averages

a) Simple moving average (SMA)

It is obtained by computing the simple average of price data over a defined period of time. In general, we compute the simple moving average based on the closing price of the security as it is considered to have more significance as compared to the rest of price points (Namely open/high/low price for the day). Thus, a 5-day SMA is calculated by adding the closing price of 5 days and dividing this sum by the total number of days (in this case, five).

For example, the 5 days SMA of ITC is calculated as follows:

While calculating the Moving Average after the close of the trading session on July 7, 2017, we can compute the SMA value by taking the closing price of the last 5 trading session, including July 7, 2017, and dividing the same by 5. At close of the next trading session on July 10, 2017, SMA is calculated by excluding the Closing Price of July 3, 2017 by adding the new data point. (Closing Price of July 10, 2017).

As illustrated in the example below, prices gradually decreases from 342.5 to 328.85 over a period of eight days in the same timeframe the 5 Period SMA decreases from 336.44 to 332.79, indicating a lag associated with the Moving Averages. Hence, larger the time period, larger is the lag.

Date

Close Price

5 Period SMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

10-Jul-17

333.30

334.60

11-Jul-17

330.40

333.23

12-Jul-17

328.85

332.89

7TH July SMA = 336.44= (342.50+337.25+331.05+337.10+334.30)
                                                                          5 

10th July SMA =334.6=        (337.25+331.05+337.10+334.30+333.30)
                                                                          5         
11th July SMA= 333.23=   (331.05+337.10+334.30+333.30+330.40)
                                                                          5
12th July WMA= 332.89=    (337.10+334.30+333.30+330.40+328.85)
                                                                          5

b) Weighted moving average (WMA)
Weighted moving average moves a step ahead from simple moving average. Here, we assign a weight to each value, with a bigger weight assigned to the most recent data points as they are more relevant than historical data points. The sum of weights should add up to 1 (or 100%). As new data points are added, the new weights will align accordingly. In contrast, in simple moving average, each value is assigned the same weight. Ideally, traders calculate WMA on the basis of closing price.

The weighted moving average is calculated by multiplying the given price by its assigned weight and then dividing the sum by total number of days. The weights assigned are subjective in nature, and it is based on the discretion of the trader. Because of its calculation methodology, WMA will follow prices more closely than a corresponding SMA. The WMA reduces the lag effect to an extent.


Date

Close Price

Weights

WMA

03-Jul-17

342.5

0.07

04-Jul-17

337.25

0.13

05-Jul-17

331.05

0.20

06-Jul-17

337.10

0.27

07-Jul-17

334.30

0.33

335.34

10-Jul-17

333.30

334.29

11-Jul-17

330.40

332.89

12-Jul-17

328.85

331.43

 

7TH July WMA = 335.34= (342.50*0.07+337.25*0.13+331.05*0.20+337.10*0.27+334.3*0.33)
                                                 5

10th July WMA =334.29=        (337.25*0.07+331.05*0.13+337.10*0.20+334.3*0.27+333.3*0.33)
                                                 5
11th July WMA= 332.89=   (331.05*0.07+337.10*0.13+334.30*0.20+333.3*0.27+330.4*0.33)
                                                 5
12th July WMA= 331.43=    (337.1*0.07+334.30*0.13+333.30*0.20+330.4*0.27+328.85*0.33)
                                                 5

C) Exponential moving average (EMA)
Exponential moving average differs from the simple and weighted moving average as an EMA is calculated by taking all the historical data points since the inception of the stock. Ideally, to calculate 100% accurate EMA, we should make use of all the closing prices right from the time of the listing of stock.

Calculation of the EMA is a 3 step process

Step 1: Since it is not practical to calculate historical data right from the inception of the stock, we use the SMA value as the initial EMA value. So, a simple moving average is used as the previous period's EMA in the first calculation.
Step 2: We calculate the weighting multiplier by dividing 2 by the sum of total periods and 1.
Step 3:  We subtract the EMA of the previous day from the current closing price, and multiply this number by the multiplier. We then add this product with its previous period EMA to find out the final EMA value.

Therefore, the current EMA value will change depending on how much past data we use in our EMA calculation. The more data points we use, the more accurate our EMA will be. The goal is to maximize accuracy while minimizing calculation time.

Initial EMA value = 5-period SMA

Weighting Multiplier= (2 / (Time periods + 1)) = (2 / (5 + 1) ) = 0.3333 (33.33%)

EMA= {Close – EMA of previous day} x multiplier + EMA (previous day).

A 5-period EMA applies a 33.33% weighting to the most recent prices. A 10-period EMA has a weighting multiplier of 18.18%. The shorter the time period, larger the weighting multiplier will be. We notice that as the time period doubles, the weighting multiplier drops ~50%.

Date

Close Price

5 Period SMA

Weighting factor

5 Period EMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

336.44

10-Jul-17

333.30

334.60

0.3333

335.39

11-Jul-17

330.40

333.23

0.3333

333.73

12-Jul-17

328.85

332.79

0.3333

332.10

7TH July EMA = 5 Period SMA= 336.44
10THJuly EMA = 335.39= (333.30-336.44) x0.33 + 336.44
11THJuly EMA = 333.73= (330.40-335.39) x0.33 + 335.39
12THJuly EMA =332.10= (328.85 -333.72) x0.33 +333.72

Comparison of the 3 moving averages
As we see by comparing the computation methodology of the 3 moving averages, different values are generated. EMA is most commonly used by traders.

Moving Averages

SMA

WMA

EMA

Advantages

1)Smoothened Average
2)Less prone to whipsaw
3)Best average to consider for support & resistance

1)Reduction in price lag, so can be implemented for short term trading 

1)Reduction in price lag, hence can be used for short term trading
2)No omission in price data points

Disadvantages

1)Has  maximum price lag
2) Assigns same weight to all price data.
3)Omission of previous data points leading to all price data not made use of

1) Omission of previous data points leading to all price data not made use of
2) Chance of whipsaw

1)Chance of  whipsaw

Moving Average Value comparison – The following table represents a comparison between the different values of the 3 types of Moving Averages over the same period of time

Date

Close Price

 5 Period SMA

5 Period WMA

5 Period EMA

03-Jul-17

342.5

04-Jul-17

337.25

05-Jul-17

331.05

06-Jul-17

337.10

07-Jul-17

334.30

336.44

335.34

336.44

10-Jul-17

333.30

334.60

334.29

335.39

11-Jul-17

330.40

333.23

332.89

333.73

12-Jul-17

328.85

332.89

331.43

332.10

Graphical comparison on the 3 moving averages.

(Blue-5 Period EMA, Green-5 Period WMA, Pink-5 Period SMA)

As we seen in the above graph, when there is a sharp correction in price as in the case of ITC, EMA and WMA reacted  the most since they are assigned a higher weight to the most recent prices as compared to the SMA.

Applications of moving average

Trend Identification

Traders use moving averages to identify the trend in a stock. A rising 200day moving average reflects that the long term trend is up and stock can be traded with a positive bias. Similarly, a falling 200day moving average reflects a long term downtrend and hence we can consider shorting the stock or refraining from investing in it.

(Blue-10 Period EMA, Green -89 Period EMA, Pink 200 Period EMA)

From the above graph, we can clearly see that L&T Fin is in a long term uptrend, the short term and medium term averages are trading above its long term, 200day moving average which is also showing an upward momentum. A price dip towards its medium term average can be considered as a buying opportunity.

Buy/Sell signals based on crossover

A buy signal is generated when a bullish crossover occurs i.e. the short term moving average crosses the long term moving average, popularly referred to as a golden cross. For example, when the 89day EMA crosses above the 200day EMA, a bullish trade can be initiated. On the other hand, a bearish dead cross occurs when the short term moving average crosses below the long term moving average.   The signals generated tend to occur with a lag as we make use of 2 lagging indicators. The best trading opportunities are obtained in a trending market as compared to the sideways market wherein whipsaws or false signals are generated.

Price

89 Period EMA

Action /View

Technical Term

Trading Above 200EMA

Crosses above  200EMA

Bullish

Golden cross

Trading Below 200EMA

Crosses below   200EMA

Bearish

Dead cross

From the above graph we see how moving averages can be used to generate trading signals

 

Moving averages can also be used to generate signals with simple price crossovers. A bullish signal is generated when prices move above the moving average. A bearish signal is generated when prices move below the moving average. Advantage of price signals is that the time lag is reduced and traders are able to react at an early stage.

As in the Fortis Ltd case shown above, traders could have initiated a short position or could have closed their long positions when the stock price closed below its 200day EMA. Consequently, a huge surge in trading volumes with MACD Histogram getting into the negative territory indicated a change in momentum which gave added information to traders to take a bearish view, resulting in a fall in stock price by 18%.

Support & Resistance Levels

Moving averages also tend to act as support and resistance levels. A stock in a long term uptrend could find support near its medium term EMA during a pullback, similarly a stock in a long term downtrend could face resistance near is medium term moving average during any bounce back. In fact, some moving averages may offer support or resistance simply because it is widely used by many traders. As an example, a trader may not short a stock if it is trading near its 200day EMA because of the fear that other traders may be using it as a buying zone.

In the above example of JSW Steel, we see how the stock has taken support along its medium term 89day EMA on multiple occasions and has acted as a good support level to purchase the stock.

Moving Averages in sync with Candlestick pattern

Moving averages can also be traded in tandem with candlestick patterns. In the above chart of Bata India Ltd, the bullish candlestick pattern can be traded with added confidence as it coincides with the support of 200day EMA.

Moving Average in sync with Price pattern

In the above chart of United Spirits Ltd, the buy signal generated by the bullish crossover coincides with a cup and handle breakout on the daily chart, affirming a bullish bias in the stock.

Construction of Indicators

Moving averages are used in the construction of technical indicators such as Bollinger Band and MACD which are widely used by market technicians. 

Key moving averages used by technical analyst

Moving averages are used based on trading horizon.

Moving Average

Trading Time frame

5 period MA

Short term

13 period MA

Short term

50 period MA

Medium Term

89period MA

Medium Term

200 period MA

Long Term

Observations on Moving Average

  • It is used in a trending market to give clear trend direction by eliminating the noise.
  • In case of a sideways market, moving average would lead to whipsaws making the use of other indicators like RSI and Stochastic more helpful.
  • Signals generated by moving averages tend to have a lag.
  • It is used best when combined with technical indicators and price patterns.

Have Referral Code?