CalcPad

Simple Moving Average Calculator

Calculate the Simple Moving Average (SMA) for a set of stock prices to identify trends.

Enter closing prices separated by commas (e.g., 150,152,148,155,160,158,162,165,163,170).

Number of periods to average. Common choices are 10, 20, 50, and 200 days.

What Is a Simple Moving Average?

A Simple Moving Average (SMA) calculates the average price of a security over a specific number of periods. It is the most basic type of moving average and is widely used in technical analysis to identify trend direction and potential support/resistance levels.

The formula is straightforward: SMA = Sum of closing prices over N periods / N

For example, a 10-day SMA takes the closing prices of the last 10 trading days and divides by 10. Each day, the oldest price drops off and the newest price is added, causing the average to "move" over time.

When the current price is above the SMA, the trend is considered bullish (upward). When below, it is considered bearish (downward). Crossovers between the price and the SMA are often used as buy or sell signals.

Common SMA Periods and Their Uses

Different SMA periods serve different purposes in technical analysis:

  • 5-10 day SMA: Short-term trend. Useful for active traders looking at momentum over a few days. Very responsive to price changes but produces more false signals.
  • 20-day SMA: Approximately one month of trading. Often used as a short-term trend indicator. Traders watch for the price crossing above or below the 20-day SMA.
  • 50-day SMA: Medium-term trend. Widely followed by both traders and investors. A stock trading above its 50-day SMA is generally considered to be in an uptrend.
  • 200-day SMA: Long-term trend. The most widely watched moving average. Institutional investors and fund managers use the 200-day SMA to determine the overall market trend. A market or stock below its 200-day SMA is often considered bearish.

The Golden Cross and Death Cross

Two of the most well-known SMA-based signals are the Golden Cross and Death Cross, which occur when shorter and longer-term moving averages cross:

Golden Cross: The 50-day SMA crosses above the 200-day SMA. This is considered a bullish signal indicating the start of a potential long-term uptrend. Historically, Golden Crosses have preceded significant market rallies.

Death Cross: The 50-day SMA crosses below the 200-day SMA. This is considered a bearish signal suggesting the start of a potential downtrend. The term sounds dramatic, but false signals do occur.

While these signals are widely followed, they are lagging indicators based on past prices. By the time a Golden Cross or Death Cross occurs, a significant portion of the move may have already happened. They work best as confirmation of existing trends rather than predictive tools.

Frequently Asked Questions

How do I get stock prices to enter into this calculator?
You can find historical closing prices on financial websites like Google Finance, Yahoo Finance, or your broker's platform. Look for "Historical Data" on a stock's page, then copy the closing prices for the period you want to analyze. Paste them as comma-separated values.
What is the difference between SMA and EMA?
The Simple Moving Average (SMA) gives equal weight to all prices in the period. The Exponential Moving Average (EMA) gives more weight to recent prices, making it more responsive to new information. EMA reacts faster to price changes but can produce more false signals. SMA is smoother and better for identifying longer-term trends.
Should I buy when the price crosses above the SMA?
Moving average crossovers can be useful signals, but they should not be used in isolation. A price crossing above the SMA suggests bullish momentum, but false signals are common, especially in choppy or sideways markets. Combine SMA signals with other indicators, volume analysis, and fundamental research before making trading decisions.
What does the trend signal number mean?
The trend signal shows 1 when the latest price is above the SMA (bullish), -1 when below (bearish), and 0 when exactly equal. This provides a quick visual indicator of whether the current price trend is positive or negative relative to the moving average.

Related Calculators