Direct Answer
The Simple Moving Average (SMA) on TradingView is a built-in indicator that calculates the arithmetic mean of an asset's closing price over a defined number of bars. Its formula is straightforward: SMA = Sum of N closing prices ÷ N. Because every bar in the lookback window carries identical weight, the SMA is smoother but slower than weighted alternatives like the EMA. On TradingView, you apply it through the unified "Moving Average" indicator by setting the Method dropdown to "SMA," then configuring the Length (period) and Source (price type). Its primary role is not entry timing — it is trend filtering: the 50 and 200-period SMAs define macro trend direction and identify dynamic support and resistance zones for institutional and retail traders alike.
Key Takeaways
- Formula: SMA = (P₁ + P₂ + ... + Pₙ) / N — equal weighting across all N periods; no recency bias.
- Best role on a chart: Trend direction filter and dynamic support/resistance level, not a precision entry tool.
- The 200-day SMA is one of the most widely followed long-term moving averages in equity, forex, and index markets — but it is not guaranteed support or resistance.
- Lag is not a bug — it is the feature: The SMA's smoothness filters noise precisely because it reacts slowly. Understanding this prevents misuse.
- The Golden Cross (50 SMA crosses above 200 SMA) and Death Cross (50 SMA crosses below 200 SMA) are the most cited long-term trend signals in technical analysis.
Quick Framework: How to Use SMA Correctly
- Use the 200 SMA for macro trend context — not precision entries.
- Use the 50 SMA to judge medium-term trend structure — is the trend still intact after a pullback?
- Use the 20 SMA for short-term pullback context only when the 50 and 200 SMA already confirm trend direction.
- Avoid treating a single SMA touch as a signal. Price touching a moving average is not confirmation — look for a candle pattern or volume change at the level.
- Test SMA behavior with historical replay before using it in live trading. What looks obvious in hindsight often behaves differently in real time.
- Always combine SMA context with price action, volume, and risk management. SMA alone is not a complete trading strategy.
The SMA Formula: What the Calculation Actually Does
The Simple Moving Average formula assigns every bar in the lookback window an identical weight of 1/N:
$$\text{SMA}_n = \frac{P_1 + P_2 + P_3 + \cdots + P_n}{n}$$
Where:
- P₁ through Pₙ = the closing price of each bar in the lookback window
- n = the number of bars in the period (Length setting in TradingView)
Worked example — 5-period SMA:
| Bar | Close Price |
|---|---|
| Bar 1 (oldest) | 10 |
| Bar 2 | 12 |
| Bar 3 | 14 |
| Bar 4 | 16 |
| Bar 5 (newest) | 18 |
| 5-period SMA | (10+12+14+16+18) / 5 = 14 |
When bar 6 arrives with a closing price of 20, bar 1 drops out of the window:
(12+14+16+18+20) / 5 = 16
The SMA line steps forward by 2 points. Notice that bar 6's closing price of 20 only contributed 1/5 of the movement — the same influence as bar 2's data from four bars ago. This equal-weighting property is what creates the SMA's characteristic lag.
How to Add the SMA to Your TradingView Chart
TradingView consolidates all moving average types into a single unified "Moving Average" indicator, accessed through the Technicals tab.
Step 1 — Open the Indicators Menu
Click the Indicators button in the top toolbar, or press / as a keyboard shortcut.
Step 2 — Search and Select
Type Moving Average in the search bar. Click the official built-in Moving Average listed under Technicals. The indicator loads on your chart with a default 9-period SMA.
Step 3 — Set Method to SMA
Hover over the indicator label in the top-left of the chart pane. Click the gear icon (Settings). In the Inputs tab, locate the Method dropdown. Confirm it is set to SMA.
Step 4 — Configure Length and Source
| Setting | What It Controls | Common Values |
|---|---|---|
| Length | Number of bars included in the average | 20 (short), 50 (medium), 200 (long) |
| Source | Which price point is averaged | Close (default), Open, High, Low, hl2, hlc3 |
| Offset | Shifts the line forward or back N bars | 0 (default); rarely changed |
For a standard 200-period SMA trend filter, set Length to 200 and Source to Close.
Step 5 — Style the Line for Readability
Navigate to the Style tab. Assign distinct colors when using multiple SMAs — for example:
- 200 SMA: Red or dark gray (macro trend anchor)
- 50 SMA: Orange (medium-term trend)
- 20 SMA: Blue (short-term dynamic support)
Set thickness to 2 or 3 pixels to keep the lines visible without cluttering price action.
SMA as a Trend Filter: Three Practical Frameworks
The SMA's value is not in telling you when to enter — it is in telling you in which direction to trade. Three frameworks are widely used:
1. The 200 SMA Macro Filter
Rule: Trade in the direction the current price sits relative to the 200-period SMA on the Daily chart.
- Price consistently above the 200 SMA → prioritize long setups.
- Price consistently below the 200 SMA → prioritize short setups or stay in cash for equity investors.
This single filter eliminates a large class of low-probability counter-trend trades. The 200-day SMA is one of the most widely followed long-term reference levels in equity and forex markets. Because many traders monitor the same level, it can sometimes behave like a self-reinforcing zone — but it should never be treated as guaranteed support or resistance.
2. The Golden Cross and Death Cross
Rule: Use the 50/200 SMA crossover on the Daily chart as a macro trend confirmation signal.
| Signal | Condition | Interpretation |
|---|---|---|
| Golden Cross | 50 SMA crosses above 200 SMA | Long-term bullish trend shift |
| Death Cross | 50 SMA crosses below 200 SMA | Long-term bearish trend shift |
Critical limitation: Because the 200 SMA is highly lagged, the Golden Cross or Death Cross frequently occurs well after the major price move has already happened. Treat these signals as macro context indicators, not as precise entry triggers.
3. The SMA Pullback Entry
Rule: In a confirmed uptrend (price above 50 and 200 SMA), wait for price to pull back to the 20 or 50 SMA before looking for bullish candle signals to enter long.
This approach uses the SMA as a dynamic support zone rather than a crossover signal. The pullback entry reduces lag impact by not requiring the moving average to "catch up" to price — instead, price returns to the moving average level.
Why the SMA Lags — and Why That Matters for Your Setup
Every beginning chartist eventually asks the same question: "Why does the signal come after the price move has already happened?"
The answer is mathematical. In a 200-period SMA, today's closing price contributes exactly 1/200 (0.5%) of the total average. The price from 200 bars ago contributes the same 0.5%. A sudden sharp rally in today's price barely moves the SMA line because 199 older data points are pulling it backward toward where price used to be.
Practical consequence:
In many sharp trend reversals, traders may observe a 20-period SMA beginning to reflect the new direction within a handful of bars, while a 200-period SMA can remain visually anchored for dozens of bars longer. These are not fixed rules — the exact delay depends on the size and speed of the price move, prevailing volatility, and the timeframe being used. The best way to develop an intuition for lag is to observe it directly through historical replay.
Why this matters for your trading plan:
If you use the 200 SMA as an entry signal (e.g., buy when price crosses above the 200 SMA), you are typically entering long after a significant portion of the move has already occurred. If you use it as a filter (buy pullbacks only when price is already above the 200 SMA), you absorb its lag into your decision framework instead of fighting it.
How to Verify SMA Lag on Historical Charts
Understanding lag conceptually is not the same as internalizing it viscerally. The fastest way to build an intuitive grasp of how the SMA behaves is to watch it respond to a sharp price move in real time using historical replay.
Recommended exercise:
- Load any major equity or forex pair on TradingView (or a browser-based replay tool like ChartMini).
- Add a 200-period SMA to the Daily chart.
- Navigate the replay to a date just before a major market move — for example, the COVID crash of February–March 2020, or the 2022 bear market beginning.
- Play the chart forward bar-by-bar and observe:
- At what point did price clearly break below the 200 SMA?
- How many bars later did the 200 SMA itself begin trending downward?
- What was the price distance between the actual trend reversal and the SMA crossover point?
This exercise makes abstract lag concrete. Most traders who complete it report that the 200 SMA crossover signal came weeks after the price had already fallen significantly — reinforcing why the 200 SMA belongs in a trend-context role rather than an entry-signal role.
ChartMini provides historical K-line replay on stocks, forex, and crypto in a browser without requiring broker registration — making it a practical tool for this specific exercise.
A 10-Minute Test: Does the 200 SMA Actually Help Your Decisions?
Instead of assuming the 200 SMA improves your trading, test it directly on historical data:
- Pick 10 to 20 random daily charts from 12 to 24 months ago.
- Open a replay session and hide all future price action.
- First pass: Replay without any moving average and write down your directional bias for each session.
- Second pass: Add the 200 SMA and replay the same sessions. Write down your bias again.
- Compare the two sets of answers. Did the 200 SMA change your directional read? Were those changes correct?
- Track three numbers: how many counter-trend trades did the SMA prevent, how many valid trades did it filter out, and whether it added clarity or just visual comfort.
This exercise converts the 200 SMA from an assumption into a tested tool. If it did not change your decisions, it is adding noise, not signal. If it consistently kept you out of counter-trend trades, it is doing its job.
If you are new to replay-based practice, read our guide on how to practice trading with historical charts in 15 minutes a day before running this test.
Common SMA Mistakes That Cost Traders Money
Mistake 1: Using the 200 SMA as an Entry Signal
The 200 SMA is not designed for precision entries. Treating a price-above-200-SMA cross as a buy signal typically results in entries at the end of an extended move.
Fix: Use the 200 SMA to establish directional bias only. Combine it with price action signals (e.g., bullish candle formations at a key support zone) for actual entry triggers.
Mistake 2: Applying the Same SMA Length to All Timeframes
A "200 SMA" on a 1-minute chart covers only 200 minutes — about three hours of trading. A "200 SMA" on a Daily chart covers 200 trading days — approximately 10 months. They are not comparable indicators.
Fix: Always specify your SMA setting as "[Length] [Timeframe]" (e.g., "200 Daily SMA") rather than just "200 SMA" to avoid ambiguity in your trading plan.
Mistake 3: Stacking Multiple SMAs of Similar Length
Adding a 20 SMA, a 21 SMA, and a 22 SMA to the same chart creates the illusion of analytical depth while adding no unique information. All three lines track the same data window within one bar.
Fix: Use SMAs with meaningfully different lengths — for example, 20, 50, and 200 — to represent different time horizons (short, medium, and long-term trends) simultaneously.
Frequently Asked Questions (FAQ)
Is the SMA a good indicator for beginners?
Yes. The SMA is one of the best starting points for beginners because its formula is transparent and its behavior is predictable. Understanding how it calculates — and specifically why it lags — teaches the foundational concept that all technical indicators are derivatives of past price data, not predictors of the future.
Should I use SMA or EMA on TradingView?
Use SMA when you want a stable, slow-moving reference for major trend direction and key support/resistance levels (e.g., the 50 and 200 SMA on daily charts). Use EMA when you need a faster, more responsive line for intraday momentum and shorter-term pullback entries (e.g., the 9 and 21 EMA on hourly charts).
Can I apply the SMA to volume instead of price?
Yes. In TradingView's Moving Average indicator settings, you can change the Source field from "Close" to "Volume." This produces a volume moving average line, which is commonly used to identify whether current volume is above or below its recent average — a useful confirmation filter for breakout setups.
What is the SMA crossover strategy?
An SMA crossover strategy generates a buy signal when a shorter SMA (e.g., 50-period) crosses above a longer SMA (e.g., 200-period), and a sell signal on the reverse cross. While widely cited, pure SMA crossover strategies are highly susceptible to whipsaws in ranging markets and should be combined with a trend strength filter like the ADX before being relied upon.
SMA vs EMA: Which One Should You Use on TradingView?
| Feature | SMA | EMA |
|---|---|---|
| Price weighting | Equal weight for all bars in the window | More weight on recent bars |
| Responsiveness | Slower; reacts gradually to new data | Faster; reacts quickly to recent moves |
| Smoothness | Smoother; fewer false signals in slow markets | Noisier in choppy or sideways markets |
| Best use | Long-term trend filter and key reference levels | Short-term momentum tracking and entry timing |
| Common settings | 50, 100, 200 (daily charts) | 9, 12, 21, 50 (hourly or shorter timeframes) |
| Main risk | Too slow to signal reversals in time | More false crossover signals during consolidation |
In practice, many traders use both together: the 200 SMA on the daily chart for macro trend direction, and a shorter EMA (such as the 21 or 50) on an hourly chart to time pullback entries within that trend.
On TradingView, switching between SMA and EMA requires only one step: change the Method dropdown in the indicator's Input settings. Both are accessed through the same unified "Moving Average" built-in indicator.
Educational note: The SMA is a lagging technical indicator based on historical price data. It does not predict future prices and should not be used as a standalone buy or sell signal. Moving average strategies can fail in ranging markets, during news events, and in low-liquidity conditions. Use SMA signals as educational tools and always apply risk management.
Next Steps
- Add a 50 and 200 SMA to your Daily chart now. Observe where the current price sits relative to both. This gives you an immediate macro trend context before placing any trade.
- Run the 10-minute replay test described above. Test whether the 200 SMA actually changes your directional decisions — do not assume it does.
- Practice identifying SMA pullback entries on a historical chart replay tool before using this setup in a live market. The goal is to confirm you can recognize the setup in real time, not only in hindsight.
- Limit your chart to two SMAs maximum. Start with the 50 and 200. Once you understand their behavior across trending and ranging markets, consider whether a shorter SMA adds analytical value or only visual complexity.
References and Resources
- Investopedia – Simple Moving Average (SMA) Definition and Formula.
- TradingView Help Center – How to Apply Indicators to a Chart.
- TradingView – Plan Pricing and Indicator Limits.
- OANDA – Moving Average Strategies and Trend Filtering.
- Charles Schwab – Understanding Technical Indicators: Moving Averages.
Further Reading
- Technical Analysis of the Financial Markets by John J. Murphy — Chapter 9 covers moving averages in depth, including the mathematical basis for SMA lag and its implications for trend-following strategies.