Simple Moving Average (SMA)

A technical analysis indicator that is used to gauge the long-term direction of the price of any script

Author: Shalin Mandhane
Shalin Mandhane
Shalin Mandhane
Reviewed By: Wissam El Maouch
Wissam El Maouch
Wissam El Maouch

Procurement Analyst Intern for Energy Storage | Chemical Engineering | Energy Economics and Management

Last Updated:March 29, 2024

What Is a Simple Moving Average (SMA)?

A Simple Moving Average (SMA) is a popular technical analysis indicator used to smooth out price fluctuations and identify trends in financial markets.

SMA computes a share's average closing price over a specified period, which can range from days to years, according to the trader's preferences. For example, a 50-day SMA calculates the average price of a security over the past 50 days. 

The formula to calculate SMA is as follows:

SMA = (Sum of Closing Prices over n Periods) / n 

where "n" is the number of periods chosen for the calculation of the SMA.

When new data points are added, the oldest data point is eliminated, and the computation is repeated to get a new average. This process is often referred to as "rolling" the SMA.

Once the SMA is calculated, it is plotted on a chart as a line, allowing traders to see the overall trend of a security's price movement over time.

The SMA line acts as a moving support and resistance level that helps traders identify key price levels that may signal potential buying or selling opportunities.

For example, if a stock's current price is above its 100-day SMA, it may indicate an uptrend. In contrast, if the stock trades below its 100-day SMA, it may imply a price decline. 

Overall, SMA is a basic but useful tool in technical analysis that can help traders and investors identify trends in stock prices and potentially make informed trading decisions. 

It is crucial to note that the SMA is not an infallible instrument, and traders should constantly confirm their trading decisions using other technical indicators and fundamental analysis.

Key Takeaways

  • A Simple Moving Average is a widely used technical analysis indicator that calculates the average closing price of a security over a specified period.
  • The formula to calculate SMA is straightforward: it involves summing up the closing prices over a certain number of periods and dividing by the number of periods. As new data points come in, the oldest ones are dropped, and the computation is repeated, creating a "rolling" average.
  • SMA can be utilized in various trading strategies, such as the "Buy Above Sell Below SMA" strategy and the "Moving Average Crossover System."
  • SMA is a lagging indicator that doesn't account for volatility.

Calculating the Simple Moving Average

The simple moving average is calculated by adding the closing prices of a security for a specific number of periods and dividing the sum by the number of periods.

For example, assume you wish to calculate the 5-day SMA of a cryptocurrency 'ABC Coin' on the 8th of April 2023. Therefore, we will add up the closing prices of the underlying over the last five days.

Closing Prices

Date Closing Price
03 April 2023 $68
04 April 2023 $69
05 April 2023 $69.5
06 April 2023 $68.5
07 April 2023 $70

The sum of closing prices is 345. On dividing this total by 5, we get $69 as the average. Hence the average closing price of ABC Coin in the past five days has been $69.

However, on April 9, 2023, we will have to take new data points to calculate the SMA. Therefore, we will drop the data from April 3rd and add data from April 8th instead.

Closing Prices

Date Closing Price
04 April 2023 $69
05 April 2023 $69.5
06 April 2023 $68.5
07 April 2023 $70
08 April 2023 $71

In this case, the sum of closing prices comes out to be 348. On dividing this total by 5, we get $69.6 as the average. Hence the average closing price of ABC Coin in the past five days has been $69.6.

One can note that we have considered the most current data (the 8th of April) and disregarded the oldest data to get the 5-day average (the 3rd of April). 

To calculate the most recent 5-day average, we start with the most recent data point and discard the oldest. Thus, the term "moving" average was coined for this indicator.

Just as we have calculated the 5-day averages on the 8th and the 9th of April, we can continue doing so in the upcoming sessions. Below is a visual representation of the data for the following days in a tabular form.

5-day Averages

Data Point No. Date Close Price 5-Day Average
1 03 April 2023 68 -
2 04 April 2023 69 -
3 05 April 2023 69.5 -
4 06 April 2023 68.5 -
5 07 April 2023 70 69
6 08 April 2023 71 69.6
7 09 April 2023 71.5 70.1
8 10 April 2023 72 70.6
9 11 April 2023 74 71.7
10 12 April 2023 73 72.3
11 13 April 2023 71.5 72.4
12 14 April 2023 70 72.1
13 15 April 2023 69 71.5
14 16 April 2023 69.5 70.6
15 17 April 2023 69 69.8
16 18 April 2023 69.5 69.4

This data, when visualized on a chart, will look something like this:

SMA graph

While the orange line represents the 5-day simple moving average, the blue line represents the cryptocurrency's price action. By now, you must have noticed that the SMA line has been drawn by joining the 5-day average points.

Trading Strategies Using Simple Moving Average

The simple moving average is a widely used tool for the technical analysis of assets listed in various financial markets. In addition, many trade selection methods may be created using moving averages.

These are a few popular SMA-based trading techniques.

1. Buy Above, Sell Below SMA Strategy

The simple moving average may be utilized to spot potential buying and selling opportunities. When a stock trades above its average price, it indicates that the market participants are ready to pay more for the stock than the average price. 

This, in turn, indicates that the traders hope the stock price will rise. As a result, one should consider purchasing opportunities.

However, when the stock trades below its average price, traders are prepared to sell it for less than its average price. This indicates that the traders are pessimistic about the direction of the stock price. As a result, one ought to consider selling opportunities.

Based on these results, we may create a straightforward trading strategy. For example, we can use a  50-day simple moving average and use two simple guidelines:

  1. Purchase when the current market price crosses the 50-day moving average. After going long, you should keep investing until the required sell condition is met.
  2. When the market price drops below the 50-day SMA, exit the long position (square off).

Here, we are using the 50-day average. However, one can use different periods per their requirement and time horizon.

The stock chart above shows a direct application of the strategy discussed above. At point 1, the stock price moves above the SMA, so we will buy the stock until the price drops below the SMA line.

At point 2, the price drops below the SMA line. Hence we will sell. Similarly, we will buy at point 3, sell at point 4, buy at point 5, and sell at point 6. Finally, we will buy at point 7 and stay in the trade if the price stays above the SMA.

Here is a quick summary of the gains we have made from our trading system:

Trading Gains

Trade No. Entry Exit Profit
1 (Point 1-2) 1380 1581 201
2 (Point 3-4) 1598 1571 -27
3 (Point 5-6) 1600 1771 171

Notably, the first and last deals were quite successful, but the second trade ended in a loss. Consequently, it is reasonable to assume that only some deals this strategy suggests would be profitable. 

This trading strategy will offer us many trades, especially when the markets turn sideways. But it is incredibly difficult to distinguish the big winning trade from the not-so-profitable or loss-making trade.

Therefore, the trader shouldn't pick and choose the indications that the moving average method suggests. In actuality, the trader must execute all recommended bets by the system. 

With a moving average strategy, losses are reduced, but one large trade might compensate for all of your losses and provide you with good winnings.

2. Moving Average Crossover System

As mentioned above, the issue with the buy above sell below SMA strategy is that it produces excessive trade signals in a sideways market. 

That's where the moving average crossover system comes into play. A variation on the standard moving average system, the moving average crossover system benefits the trader by allowing him or her to place fewer deals.

With an MA crossover strategy, the trader mixes two moving averages rather than the standard single moving average. For example, a trader can choose combinations such as:

  • 9-day SMA with 21-day SMA (for short-term trades lasting up to a few sessions)
  • 50-day SMA with 100-day SMA (for trades lasting up to a few months)
  • 100-day SMA with 200-day SMA (for long-term investment opportunities).

The shorter moving average is called the faster moving average, whereas the longer moving average is called the slower moving average. Because the shorter moving average has fewer data points to compute, it tends to stick closer to the current market price of the underlying and responds faster. 

On the other hand, the longer moving average requires more data points to compute; hence, it tends to deviate from the current market and responds slower.

The crossover system's entry and exit guidelines are as follows:

  1. Purchase when the short-term moving average crosses over the long-term moving average. As long as this criterion is met, continue holding the underlying.
  2. When the short-term moving average turns lower than the long-term moving average, exit the long position (square off).

Let us bring the strategy into practical utility by using it on the price chart.

Here, we are viewing the price chart of the same stock we viewed in the buy above sell below SMA strategy. The blue line on the chart represents the 100-day moving average, and the orange line represents the 50-day moving average.

Notice how, instead of giving many signals (the way buy above sell below SMA strategy did), the crossover strategy gives only a few signals. 

The first signal is given at point 1 when the faster moving average crosses over the slower moving average. This is a buy signal, and we hold on to the trade as long as the faster-moving average does not turn lower than the slower-moving average.

We finally get a sell signal at point 2 and a buy signal at point 3 again. Here is a quick summary of the gains we have made from the crossover system:

Gains Made from the Crossover System

Trade No. Entry Exit Profit
1 (Point 1-2) 701 2000 1299
2 (Point 3) 1550

Sell signal not yet received. But the trade is profitable.

-

The crossover system gave us very few trades but highly profitable ones. Although the crossover system will give us fewer trades than the buy above sell below SMA strategy, it is crucial to remember that not all trades the system gives will be successful. 

Again, the key to using the crossover strategy successfully is to execute all the recommended trades by the system. Though a few trades might result in a loss, this loss will be minimal, and one good trade might make up for all of your losses and provide you with sufficient profits.

Advantages of Simple Moving Average

There are several advantages to using a Simple Moving Average (SMA) in stock markets. Here are a few:

1. Identifies Trends

SMA is a useful tool to identify trends in stock prices. By plotting the SMA on a chart, traders can easily identify whether a security is in an uptrend or a downtrend. This information is crucial for traders to make informed trading decisions.

2. Smooths Out Price Fluctuations

SMA smoothes out the fluctuations in price movements, providing traders with a clearer picture of the overall trend in the market. This helps traders to avoid making hasty and emotional trading decisions based on short-term price movements.

3. Provides Support and Resistance Levels

The SMA line acts as a moving support and resistance level that helps traders identify key price levels that may signal potential buying or selling opportunities.

Note

Support and resistance levels are important for traders as they provide a reference point for stop-loss orders or profit-taking levels.

4. Easy to Use

SMA is a basic tool that is easy to use and understand. It is widely available on most trading platforms, and traders can customize the SMA 

5. Works Well with Other Indicators

SMA works well with other technical indicators, such as the Relative Strength Index (RSI) or Moving Average Convergence Divergence (MACD), to confirm trend direction and identify potential trading opportunities.

6. Useful for Long-term Investing

SMA is also useful for long-term investors who want to buy and hold a stock for an extended period. By using a longer-term SMA, such as a 200-day SMA, investors can identify the overall trend of a stock and make informed decisions on when to buy or sell.

Limitations of Simple Moving Average

While Simple Moving Average (SMA) has advantages, there are also some potential disadvantages. Here are a few:

1. Lagging Indicator

SMA is a lagging indicator, meaning that it is based on past price data and may only sometimes provide timely information on the current market trend. This may lead to traders entering or exiting a position too late, causing them to miss out on potential profits or incur losses.

2. It does not Account for Volatility

SMA does not account for volatility in the market, which can result in false signals. For example, during periods of high volatility, the SMA line may cross over the price multiple times, leading to confusion and uncertainty for traders.

3. Not Suitable for All Market Conditions

SMA may not work well in all market conditions. For example, in a ranging market, where the price moves within a narrow range, the SMA line may not provide useful information as it will fluctuate within that range.

4. May Not Work for All Stocks

SMA may not work well for all stocks, particularly those with low trading volumes or erratic price movements. In these cases, SMA may produce false signals or may not provide enough data points for reliable analysis.

Conclusion

One essential instrument in the toolbox of traders and technical analysts is the Simple Moving Average (SMA). It is a vital tool in the financial markets due to its ease of use and efficiency in spotting patterns, reducing price swings, and supplying crucial support and resistance levels.

SMA has several benefits, though, such as compatibility with other indicators and ease of use. Therefore, it's important to be aware of its limitations.

Since SMA is a lagging indicator, it might not always send out signals in a timely manner, which could cause traders to lose money or miss out on possibilities.

Furthermore, the necessity for care and additional research is highlighted by SMA's incapacity to account for volatility and its vulnerability to false signals in specific market conditions.

Despite these drawbacks, SMA can greatly improve traders' capacity to analyze market trends and reach well-informed conclusions when applied sparingly and in concert with other analytical tools.

Successful use of SMA requires knowing its advantages and disadvantages, customizing it to each trader's goals and trading style, and incorporating it within a thorough trading framework.

By doing this, traders will be able to take advantage of SMA's potential to negotiate constantly shifting market conditions, maximize trade entry and exit points, and pursue steady profitability in their trading pursuits.

Simple Moving Average (SMA) FAQs

Free Resources

To continue learning and advancing your career, check out these additional helpful WSO resources: