Technical indicators use formulas to generate data points. The data points are used to create alerts, confirm other indicators or analyses, and forecast prices.
Moving averages are one of the most popular technical indicators.
Moving averages smooth a series of data points. Moving averages smooth the randomness of a security’s price fluctuations to reveal underlying trends.
Moving averages are most commonly calculated using closing prices for a specific timeframe. For example, an hourly chart would use each hour’s closing price and a daily chart would use each day’s closing price.
How to use simple moving average
A simple moving average is an arithmetic average of a set of data points where each data point is added together and then divided by the total number of data points.
A simple moving average is a smoothing tool that displays trends for a specific number of periods.
For example, a 50-period simple moving average finds the closing price of the last 50-periods, sums the 50 closing prices, and divides by 50 to calculate the average closing price of the previous 50 periods. New periods are then added to the calculation, while the oldest period is removed from the calculation.
The simple moving average is typically plotted as a technical overlay.
Simple moving averages are used to determine price trends over a specific time horizon. 10, 50, and 200-day simple moving averages are often used as default indicators to define a security's short, medium, and long-term trend.
Simple moving averages can be used for short time periods, such as the last 5 or 10 minutes on an intraday chart, or long periods, such as 10 or 20 days on a monthly or annual chart.
The moving average’s length determines the indicator’s responsiveness to new data points. The longer the moving average, the longer it takes for changes in the underlying security’s price to impact the moving average’s value. Similarly, the longer the moving average, the less likely a single data point creates a false indicator of a change in trend.
How to calculate simple moving average
To calculate a simple moving average, first determine the closing price for each data point in the SMA calculation.
Second, sum the closing prices.
Finally, divide the summed closing prices by the number of periods in the SMA.
Which is better: Simple or exponential moving average?
The longer the timeframe, the more data points, the less the reaction to new data points, and the smoother the series. One-day changes in a security’s price do not have a significant effect on longer-length moving averages. That can be good. However, if a stock’s trend changes abruptly, longer exponential moving averages take longer to adapt.
There’s a balance between responsiveness to trend changes and false signals from price outliers.
Moving averages react to data points and are not intended to be predictive like other technical indicators. Moving averages simply follow price action and exponential moving averages react more quickly to new data points than simple moving averages.
EMAs address the “drop-off effect” caused when the earliest data point rolls off of an SMA calculation.
The moral of the story: align the moving average length with your trading timeframe. For example, if you are a long-term buy-and-hold investor, the 5-day EMA shouldn’t affect your decisions.
Plus, don't miss this bot example that automates a simple trend following strategy using a simple moving average.