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?
What is the difference between SMA and EMA?
Should I buy when the price crosses above the SMA?
What does the trend signal number mean?
Related Calculators
Stock Profit Calculator
Calculate your profit or loss from buying and selling stocks, including commissions and annualized return.
Use calculator →Stock Average Calculator
Calculate your average cost per share when buying a stock at different prices over multiple purchases.
Use calculator →CAGR Calculator
Calculate the Compound Annual Growth Rate of an investment to measure performance over time.
Use calculator →