Moving average is an indicator used in technical analysis to gauge the direction of the current trend in the prices of a particular security. Moving average is not a predictor of prices, it is based on past prices. In fact, it filters out too many fluctuations in prices and provides a concrete definition to the trend.
There are two types of Moving Averages
The Simple Moving Average is a form of the moving average which is calculated by adding the closing prices of stock during specific time periods and dividing the sum by the number of time periods in the calculation average; or in simple terms, the average price over a particular time period.
The formula of Simple Moving Average
In this formula An refers to the closing stock prices at period n, and n is the total number of periods.
Let’s try to understand this with an example.
Consider the daily closing prices in a 5-day moving average.
Here, the first day of the moving average covers the last 5 days. As the days progress, the previous day’s data point is dropped and replaced by a new data point. So the second day of the MA will drop the first data point (11) and add a new one (16). The third day continues by dropping the first data point (12) and adding a new one (17).
Thus, in the example above, prices rise from 11 to 17 in a span of 7 days. You can also notice that the MA rises from 13 to 15 within 3 days. Additionally, the price of each moving average is just below the last one. This is because prices in the previous four days were lower and this causes the moving average to lag.
While the Simple moving average is based on past data, the Exponential Moving average stresses more on recent prices. The weighting applied to recent prices depends on the number of periods. This difference between SMA and EMA, makes the latter more efficient in responding to new information. In an EMA, the calculation depends on the EMA calculations of all the previous days. You need at least more than 10 days of data to calculate Exponential moving average.
There are three steps to calculating an exponential moving average.
Let's understand EMA with an example.
Consider a 10 days time period for calculating Exponential Moving average.
An exponential moving average for a 10-day time period applies an 18.18% weighting to the latest price. The weighting after applying to the most recent price is (2/(10+1) = 18.18%).
Beyond SMA and EMA, there are other moving averages used in trading:
Moving averages are widely used in technical analysis for:
While moving averages are useful indicators, they have certain limitations:
Since moving averages rely on historical data, they lag behind current market conditions.
In sideways or volatile markets, moving averages can generate false signals.
Moving averages are powerful tools in technical analysis, helping traders:
However, since MAs are lagging indicators, they should be used alongside other technical indicators like Relative Strength Index (RSI), Bollinger Bands, and MACD for more accurate trading decisions.