Explainers / RSI
What RSI actually computes
The Relative Strength Index has one setting, a length (commonly 14), and one input: the change from each close to the next. Nothing else enters. Not the high, not the low, not volume.
The formula
gain = max(close - previous close, 0)
loss = max(previous close - close, 0)
avg gain = previous avg gain + (gain - previous avg gain) / N
avg loss = previous avg loss + (loss - previous avg loss) / N
RS = avg gain / avg loss
RSI = 100 - 100 / (1 + RS)
The "average" is Wilder's smoothing, an exponential filter with weight 1/N, not a simple mean of the last N bars. So RSI is a smoothed ratio of recent up-closes to recent down-closes, squashed onto 0 to 100.
Why your RSI(14) can differ from someone else's
Wilder's smoothing never fully forgets. With N = 14, all the bars older than 100 bars still hold about 0.06% of the weight, and it takes about 62 bars before the history you did not load drops below 1%. The value on your screen therefore depends a little on where your data starts. Two people on the same symbol and timeframe can see different decimals if one chart has 300 bars loaded and the other has 5,000. Platforms that seed the first average differently (a simple mean of the first N bars, or the first value) add a second small difference. Usually it is a rounding-sized gap; anything that depends on crossing an exact threshold inherits it.
What the length setting changes
- Shorter length: each new close moves the average more, so RSI swings wider and reaches 70 or 30 more often.
- Longer length: RSI swings less and stays nearer 50.
- The 70 and 30 lines are conventions. Changing the length changes how often they are touched, so a threshold only means something together with its length.
The second line: what "RSI-based MA" is
TradingView's built-in RSI can draw a second line next to the RSI itself, labelled RSI-based MA (it is often shown in yellow next to a purple RSI). It is a moving average of the RSI values, set by the type and length under the indicator's smoothing settings. It adds no new information: it is the same close-to-close changes, averaged a second time, so it moves later than RSI. RSI length and MA length are separate settings, and changing one does not change the other.
What a reading means
A high RSI says recent closes have risen more than they have fallen, smoothed. That is all. Nothing in the formula knows what "too far" is, so "overbought" is a description of the recent past, not a forecast. In a steady trend RSI can stay above 70 or below 30 for weeks; that is the formula working as written. 50 means smoothed up-moves and down-moves are currently equal in size, nothing more.
Does RSI repaint?
Not on closed bars: once a bar has closed, its RSI value is fixed (given the same loaded history). On the live bar it changes with every tick until the close, so a cross of 70 or 30 seen mid-bar can be gone when the bar closes. RSI pulled from a higher timeframe onto a lower one is a separate case, and whether it changes after the fact depends on how the script requests that data.
Where it fails
- It sees one number per bar. A day that rallies from the low to close at the high and a day that gaps up and drifts to the same close look identical.
- It sits pinned near the extremes in trends, so fading every reading above 70 fights the trend.
- The value depends slightly on loaded history and on how the first average was seeded.
- Divergence has no single definition (which swing points, how far apart), so two people can call different divergences on the same chart.
- On the live bar the value changes until the close.
- Any edge from a threshold has to be shown out of sample for that instrument and timeframe; it is not a property of the indicator.
The Teardown Letter
The monthly Teardown Letter takes one popular indicator apart per issue in the same way: what it computes, what follows from the arithmetic, and where it misleads. Issues so far: RSI, MACD, order blocks, Fibonacci and Supertrend. New subscribers get every past issue.
Also explained: Repaint checker, VWAP, Supertrend, UT Bot Alerts, Nadaraya-Watson Envelope, Squeeze Momentum, What is repainting on TradingView?, Is TradingView backtesting accurate?, Chandelier Exit, WaveTrend Oscillator, QQE MOD, Pivot highs and lows, Hull Suite, Range Filter, Twin Range Filter, HalfTrend, ZigZag++, SSL Hybrid, CM MacD Ultimate MTF, Volume Profile / Fixed Range, ADX and DI, Support Resistance Channels, Market Structure Break & Order Block, Order Block Finder, Pivot Point SuperTrend, Trendlines with Breaks [LuxAlgo], Divergence for Many Indicators, TradingView script selling terms, Support and Resistance Levels with Break, Liquidity Swings [LuxAlgo], Pine Script errors, Breakout Probability (Expo), Did ChatGPT or Claude write your Pine Sc, Lorentzian Classification, SuperTrend AI (Clustering), Machine Learning Adaptive SuperTrend, Dynamic Swing Anchored VWAP, Support and Resistance Power Channel by , Support and Resistance (High Volume Boxe, Trendline Breakouts With Targets by Char, Breakout Finder by LonesomeTheBlue
Get the next teardown by email
One short email when a new teardown or free tool goes live, about twice a month. No signals, no hype. Unsubscribe in one click.
Almost done. Check your inbox and click the confirmation link.
Sent with Kit. Your address is used only for these emails. Privacy
No TradingView account yet? This affiliate link gives you a $15 coupon toward a paid plan, and we earn a commission if you buy one. The free plan is enough to follow this page.