What is a Moving Average and How to Use it?

The prices in the stock market keep on changing, sometimes going up and then coming down. With so much seesawing movement going on it sometimes becomes difficult to identify the trend behind the price moves. So, to overcome this problem technical analysts envisaged an indicator that smooths the price movement thus permitting us to visualize the trend behind price movements more clearly. This is how the concept of Moving Average  came into being. So, let's dive in to discover more about moving averages and their uses. The post has been written for beginners and gives a general idea about the moving averages. Let's dive in now-


What Is a Moving Average?

As the name suggests, a moving average is simply the average or mean of a body of data that changes over time. In the stock market, price is the most crucial piece of data we work with. So, a moving average is essentially the average price of a stock over a specified period of time. Most commonly, we use closing prices to calculate the moving average, but you can also apply this to other prices like highs, lows, and opens.

The "moving" part of the name means that as new data (like a closing price) comes in, the oldest data is removed from the calculation. Imagine you're keeping track of a moving average for the last 5 days; each new day’s price replaces the oldest one. 

Let us take an example to understand this concept plainly.

Let’s say we have a hypothetical stock, XYZ. The closing prices for the last 5 days of this stock are-

 100, 101, 102, 103.5, and 102.5 

 To calculate the 5-day moving average:

1. Add up the closing prices: 100 + 101 + 102 + 103.5 + 102.5 = 509

2. Divide by the number of days: 509 / 5 = 101.8

So, the 5-day  average comes out to be 101.8.

Now let us suppose on the 6th day the closing price of stock XYZ is 103. So, now you’d replace the oldest price (100) with the new one (103). 

100, 101, 102, 103.5, 102.5, 103

Your new average would be:

1. Add up the new prices: 101 + 102 + 103.5 + 102.5 + 103 = 512

2. Divide by 5: 512 / 5 = 102.4

Thus, the new 5-day moving average is now102.4. This process continues as new prices come in, making it a "moving" average. While the example above uses a 5-day moving average, you can use different periods, like 20 days, 50 days, or even 200 days. This type of moving average is called a Simple Moving Average (SMA) because it calculates the average using simple arithmetic mean.

An image showing weekly chart of RELIANCE with 50 period simple moving average


One of the problems that analysts encounter with Simple Moving Average is its lagging nature. They felt that since in a Simple Moving Average every data is given equal weightage so, the indicator lags in reacting to new price data. The technical analysts thought that by giving more weightage to recent data this lag can be reduced to some extent. This gave the idea of an Exponential Moving Average.

Exponential Moving Average (EMA)

Simple Moving Averages can be a bit slow to react to new trends because they treat all data points equally. That’s where the Exponential Moving Average (EMA) comes into play. The EMA gives more weight to recent prices, which assists it to respond more quickly to price changes. This adjustment reduces the lag to some extent (but not entirely) and provides a more timely reflection of price movements. I am not going into the calculation of EMA as all charting software these days, calculate and plot EMA and SMA quite effortlessly for you.

weekly chart of RELIANCE with 50 SMA and 50 EMA

The chart above is a weekly chart of RELIANCE with 50 period SMA (Blue Line) and 50 EMA (Green line). Notice that EMA  is a tad quicker in spotting the price changes

Beyond SMA and EMA, analysts have developed some other moving averages as discussed below briefly.

- Double Exponential Moving Average (DEMA): Reduces lag by applying EMA twice.

- Triple Exponential Moving Average (TEMA): Further reduces lag by applying EMA three times.

- Volume Weighted Moving Average (VWMA): Takes trading volume into account, giving more weight to prices with higher volume.

weekly chart of RELIANCE showing DEMA, TEMA and VWMA

The chart above shows DEMA (green line), TEMA (blue line) and VWMA (red line)

Though the moving averages discussed above can prove useful in certain specific situations, however, SMA and EMA remain the most commonly used moving averages in technical analysis. 

DEMA and TEMA can be more useful for short-term traders as they reduce lag and enable traders to make an early entry and exit. VWMA finds its usefulness when there is a wider gap between EMA and VWMA enabling the traders to find areas where volume has kicked in. 

Now that you have a good grasp of what moving averages are, let’s look at some of their key uses in trading.


How to use a Moving Average?

 1) As a Trend Indicator

Moving averages are excellent for spotting trends. If the price is above a moving average, it generally indicates an uptrend. Conversely, if the price is below the moving average, it's a downtrend. By adjusting the period for which you calculate the average, you can get different perspectives about a trend.

- Short-term: Price relative to a 21-day moving average can signal a short-term trend. This means a  price above 21 MA indicates a short term uptrend and price below it indicates a short term downtrend.

- Medium-term: A 50-day moving average provides a medium-term trend view.

- Long-term: A 200-day moving average offers insights into long-term trends.

Weekly chart of BHARTI AIRTEL with 20, 50 and 200 period MA

The above chart is a weekly chart of BHARTI AIRTEL. Notice that by analyzing moving averages in relation to price you can get an idea about the prevailing trend. The price in above chart remains above 200 SMA (redline), so, the stock is in a long term uptrend. Similarly, you can get an idea about short term and medium term trends by analyzing price with respect to 21 period and 50 period Moving averages respectively.

2) As Support and Resistance

Moving averages can act as dynamic support and resistance levels. In an uptrend, the moving average might serve as a support level, where the price tends to bounce off after trading near a moving average. In a downtrend, it might act as a resistance level. Take a look at charts below to understand this better.

50 period SMA  acting as support in this daily chart of ZOMATO


The chart above is a daily chart of ZOMATO. Notice that the 50 period SMA in the chart acts as support as shown by black arrows.

3) As Trading Signals

When the price crosses above a moving average, it’s often considered a buy signal. Conversely, when it crosses below, it’s a sell signal. However, these signals are not foolproof and should be confirmed with other indicators to improve their reliability. For details see the post-  Stock trading strategy with Moving Averages- A step-by-step guide

Daily chart of MAZAGON showing buy and sell signal
The chart above is a daily chart of MAZAGON with 50 period SMA showing buy and sell signals as price crosses above and below 50 SMA.
Apart from price crossovers there are other ways moving averages give buy/sell signals. These are moving average crossovers and triple crossovers and has been briefly discussed below.

 -MA Crossover

A moving average crossover happens when a shorter period moving average crosses above or below a longer period moving average. For instance, if a 21-day EMA crosses above a 50-day EMA, it’s often viewed as a bullish signal. The reverse crossover is considered bearish.

chart showing MA crossovers

The chart above shows 21 SMA and 50 SMA crossovers giving a buy and sell signals.

-Triple Crossover

For more precision, some traders use a triple crossover strategy involving three moving averages. For example, a 21 EMA,50 EMA and 200 EMA crossovers can signal a buy and sell signals as described below.

First, a 21-days EMA crosses above a 50-day EMA followed by 21-days EMA  crossing above a 200-day EMA. Finally, a triple crossover is said to happen when the 50-day EMA crosses above the 200-day EMA.

This sequence generates a strong albeit late buy signal. 

The reverse is true for a sell signal.

image showing triple crossover

The chart above is a daily chart of RELIANCE showing triple crossover.

4) As basis for other indicators

Moving averages form the basis for some other useful and widely used indicators. Like Bollinger Band is based on Simple Moving Average and Moving Average Convergence Divergence(MACD) is based on EMA.


Conclusion

Moving averages are a foundational tool in technical analysis that can help smooth out price data, making it easier to identify trends and make informed trading decisions. Whether you’re using them as a trend indicator, support/resistance level, or trading signal, mastering moving averages can significantly enhance your trading strategy. 

You should be experimenting with different types and periods of moving averages to find what works best for you according to your own trading style. For me its 21,50 and 200 period EMA. Happy trading!

Post a Comment

Previous Post Next Post