Price Momentum, Not a Valuation Test
RSI compares smoothed positive and negative price changes. A value below 30 does not establish that a security is undervalued, and a value above 70 does not require an immediate fall. Sustained directional price moves can keep RSI outside those bands. This calculator does not detect divergence, generate orders, or backtest a strategy.
Reproduce the Calculation
- Enter one chronological sequence of closes with the oldest first. Use the same instrument, timeframe, and price-adjustment convention throughout.
- Choose a whole lookback n. The initial averages use the first n changes, requiring n + 1 prices. Earlier rows have no RSI.
- For each later change, update each average as previous average × (n − 1) / n + new gain or loss / n.
RS = average gain / average loss; RSI = 100 − 100 / (1 + RS)
For n = 3 and closes 100, 102, 101, 103, the gains sum to 4 and losses to 1, giving RSI 80. Add a close of 100: the smoothed gain becomes 8/9 and loss 11/9, so RSI becomes 100 × 8/19 = 42.1053. Paste those five prices and choose 3 to reproduce both rows.
Boundary and History Conventions
Positive average gain with no average loss gives RSI 100; positive loss with no gain gives RSI 0. When both averages are zero, this page displays Undefined rather than inventing a direction. Other implementations can choose a different flat-series convention.
The initial seed uses only the pasted history. A chart platform may include earlier bars, a different source, session, or adjustment, so the most recent value need not match without matching those inputs. A period of 14 means 14 bars, not necessarily 14 calendar days.
Shorter smoothing responds more quickly; longer smoothing gives a smaller weight to each new change. Neither is universally more reliable or profitable. Treat period and threshold changes as hypotheses to test with explicit execution assumptions and costs.
Reference: TradingView RSI documentation describes the RSI ratio, RMA smoothing, and 14-bar default. The numeric examples and explicit flat-series handling above describe this calculator's implementation.
Frequently Asked Questions
What is the RSI formula?
RSI = 100 − 100 / (1 + average gain / average loss). This page seeds the averages from n changes and then applies Wilder smoothing with weight 1/n for each new gain or loss.
Why do I need n + 1 prices?
A lookback of n requires n price changes. Each change uses two consecutive closes, so 14 changes require at least 15 closes. Earlier table rows remain blank during warm-up.
What happens to all-rising, falling, or flat prices?
All rising changes give RSI 100 after warm-up; all falling changes give RSI 0. When both smoothed averages are zero, this calculator reports Undefined. It does not label a completely flat series overbought.
Are 70 and 30 trade instructions?
No. They are conventional momentum thresholds. They do not establish valuation or guarantee a reversal, and this page does not calculate divergence or trading performance.
Will this exactly match my TradingView chart?
Only matching source prices, timeframe, adjustment, and enough identical history can support that comparison. This tool starts its seed at the first pasted price, while a chart may include older observations. The 14-bar default is an example setting, not a universal optimum.