Average (SMA/EMA) Calculator
Category: Technical AnalysisCalculate Simple and Exponential Moving Averages to identify trends, potential support/resistance levels, and generate trading signals
Price Data Input
Moving Average Parameters
Understanding Moving Averages
Moving averages are one of the most versatile and widely used technical indicators in financial markets. They smooth out price data to identify trends and potential trading opportunities.
Simple Moving Average (SMA)
The Simple Moving Average (SMA) is calculated by taking the arithmetic mean of a given set of prices over a specific number of periods:
Where P represents prices and n is the number of periods.
- Advantages: Simple to calculate and understand; gives equal weight to all prices in the calculation period
- Disadvantages: Slower to react to price changes; older prices affect the average as much as recent prices
- Common Uses: Identifying trends, support/resistance levels, and trade signals when prices cross the SMA
Exponential Moving Average (EMA)
The Exponential Moving Average (EMA) gives more weight to recent prices, making it more responsive to new information:
Where k = 2/(n+1), and n is the number of periods.
- Advantages: More responsive to recent price changes; reduces lag in trend identification
- Disadvantages: More complex to calculate; can generate more false signals in choppy markets
- Common Uses: Short-term trading strategies, identifying trend changes more quickly
Trading Strategies Using Moving Averages
MA Crossover Strategy
A bullish signal occurs when a shorter-period MA crosses above a longer-period MA. Conversely, a bearish signal occurs when a shorter-period MA crosses below a longer-period MA.
Example: Golden Cross (50-day SMA crosses above 200-day SMA) and Death Cross (50-day SMA crosses below 200-day SMA)
Price Crossover Strategy
A bullish signal occurs when price crosses above the MA. A bearish signal occurs when price crosses below the MA.
Example: Buy when price closes above the 20-day SMA; sell when price closes below the 20-day SMA
Support and Resistance
Moving averages often act as dynamic support (in uptrends) or resistance (in downtrends). Traders look for price reactions when approaching these levels.
Example: In an uptrend, buying when price pulls back to the 50-day MA and shows signs of bouncing
Trend Filter
Using MAs to determine the market direction before applying other trading strategies. Only take long positions when price is above the MA, and short positions when price is below the MA.
Example: Only considering long trades when price is above the 200-day MA
Tips for Using Moving Averages Effectively
- Choose appropriate periods - Shorter periods (5-20) are more suitable for short-term trading, while longer periods (50-200) are better for long-term trend identification
- Combine multiple MAs - Using multiple MAs with different periods can provide more reliable signals and filter out false ones
- Use with other indicators - Combine MAs with momentum indicators (RSI, MACD) or volume indicators for confirmation
- Understand market context - MAs work better in trending markets and may generate false signals in ranging or choppy markets
- Be aware of lag - All MAs have some degree of lag; EMAs reduce lag but may be more prone to whipsaws
What this calculates
Simple and exponential moving averages over a price series.
- Formula
SMA = sum of last N closes Ć· N; EMA = price Ć k + previous EMA Ć (1 ā k), where k = 2 Ć· (N + 1)- Worked example
- For a 10-period SMA, add the last 10 closes and divide by 10. The EMA weighting for N=10 is k = 2 Ć· 11 = 0.182, so the newest close carries 18.2% of the value.
- When to use it
- To smooth noise out of a price series and see the underlying direction.
- Common mistake
- A moving average always lags. The longer the period, the later it turns ā it confirms a move, it does not predict one.