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

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

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: VWAP, Supertrend, RSI

Subscribe to the Teardown Letter: $19/moBack to Taught to Trade