Indicator library · Momentum

Relative Strength Index (RSI), Formula, Divergence and Settings

A bounded 0–100 measure of how recent gains compare to recent losses. The most widely used oscillator in technical analysis, and the one whose two famous levels are most often read as instructions rather than as observations.

The relative strength index formula

The relative strength index formula divides the average of recent gains by the average of recent losses and maps the result onto a scale from 0 to 100, where readings above 70 are conventionally called overbought and below 30 oversold. Everything the relative strength index can tell you follows from that one division: it describes the balance of up moves against down moves inside one instrument over one lookback window, and nothing else.

The name misleads, and it is the first thing to get straight. "Relative strength" in most other contexts means one instrument measured against another or against an index; the relative strength index compares an instrument only with itself. Nothing external enters the calculation. This is worth being exact about, because the confusion leads people to read RSI as a ranking tool, which it is not, a small-cap at 75 and a mega-cap at 75 are not making a comparable statement about anything except their own recent behaviour.

Two settings decide what the output looks like, and only one of them is usually stated. The period, Wilder's own default was 14. Sets how much history each reading aggregates, and the thresholds drawn on the chart decide what counts as overbought. Neither has a statistical justification, and both are worth leaving alone for the reason that runs through this whole library: a level a great many participants watch behaves differently from one nobody does. Changing settings for a reason you can state is analysis; changing them until a signal appears is fitting the formula to the past.

The full arithmetic, including Wilder's smoothing and the reason two platforms can disagree about the same period, is worked through on the RSI calculator. In short: RSI = 100 − (100 ÷ (1 + average gain ÷ average loss)), where the averages are smoothed so that each one carries the whole history forward at decreasing weight.

Price with its Relative Strength IndexThe upper panel shows a price series rising for about sixteen bars and then falling back. The lower panel shows RSI on a nought-to-one-hundred scale: it holds in the upper half through the advance, touching the seventy line, then falls through fifty as price turns and reaches the low thirties near the end of the decline.CLOSE705030RSI 848.31price highPrice with its Relative Strength IndexThe upper panel shows a price series rising for about sixteen bars and then falling back. The lower panel shows RSI on a nought-to-one-hundred scale: it holds in the upper half through the advance, touching the seventy line, then falls through fifty as price turns and reaches the low thirties near the end of the decline.CLOSE70RSI 848.31price high
Fig. 1: schematicComputed at build time by Wilder's method. The useful thing to notice is how little time the line spends near its extremes: most of an oscillator's life is passed in the middle of the range, which is precisely where it says the least. The two levels everyone quotes describe a small minority of sessions.

The three readings, and where divergence sits

Level

Above 70 the recent gains dominate; below 30 the losses do. Both are conventions, not thresholds derived from anything, and both behave completely differently depending on whether the instrument is ranging or trending. In a range they mark the edges. In a trend RSI compresses into the upper or lower half and stays there, so every crossing is a counter-trend signal in a market that is not turning.

The 50 line

Underrated and more robust than the extremes. RSI above 50 means the average gain exceeds the average loss over the window, a simple statement about which side has been winning, and one that changes far less often than the 70 and 30 crossings do. Used as a filter rather than a trigger, it is the least fragile thing this indicator offers.

Divergence

Price makes a higher high while RSI makes a lower one: the new extreme was reached with less momentum behind it than the previous one. This is the reading with the longest record, and it is also the one most easily imagined into a chart. It is a warning about the character of a move, never a timing signal: divergences have persisted for months, and they resolve into continuation often enough that acting on one alone is a coin toss with commission.

The variant nobody mentions until it bites

There are two RSIs in common use and platforms rarely say which they implement. Wilder's original smooths the gain and loss averages so that each new value carries the whole prior history at decreasing weight, the recursive form set out on the calculator page. Cutler's RSIsubstitutes a simple moving average, which forgets everything older than n bars completely.

The lines are close but not identical, and they differ in a way that matters for anyone checking a number. Wilder's value depends on how much history the calculation was given; Cutler's does not, which is why it appears in spreadsheets and in academic work where reproducibility is the point. Neither is wrong. Comparing one platform's Wilder RSI against another's Cutler RSI and concluding that one has a bug is the common outcome of not knowing the distinction exists.

Settings, and how the ranges shift in a trend

The most useful under-documented property of this indicator, and the one that explains why the 70/30 convention performs so badly in trends. Andrew Cardwell's observation is that RSI does not oscillate around 50 in a trending market: it works within a displaced band.

In a sustained uptrend the readings tend to run roughly between 40 and 80, with the 40 area acting as the floor, pullbacks stop there rather than reaching 30. In a downtrend the band shifts to about 20 to 60, and 60 becomes a ceiling the rallies fail against. The consequence for reading is direct: a fall to 40 means one thing inside an uptrend, where it is the bottom of the working range, and something quite different in a market with no trend, where it is simply mid-range and says nothing.

This also reframes what "failure to reach oversold" means. An instrument whose pullbacks have stopped at 45 for months is not refusing to become oversold; it is telling you which band it is operating in. When that floor breaks and a pullback reaches 30 for the first time in a long while, the band itself has shifted, which is a more informative event than any single crossing of a fixed line.

Failure swings: Wilder's own construction

Divergence is the reading everyone cites; the failure swing is the one Wilder actually described, and it is stricter in a way that makes it harder to imagine into a chart.

A bearish failure swing has four parts in sequence: RSI rises above 70; it pulls back to some level; it rallies again but fails to exceed the previous high; and it then breaks below the low of that intervening pullback. Only the break completes it. The bullish version is the mirror image below 30.

The value of the construction is procedural rather than predictive. A divergence is a visual impression, and the eye is extremely good at finding them in retrospect; a failure swing is a sequence that either completed or did not, with a specific price on the chart where it did. Whether it works better is an open question. That it can be stated unambiguously before the fact is not.

A worked reading

An instrument has been rising for four months. RSI has spent that time between 45 and 82, touching 82 twice. It now pulls back to 47 while price makes a slightly higher low than the previous pullback. What can be said?

  • Supported: the working band is displaced upward, which is characteristic of an uptrend. The pullback to 47 is inside that band, not near its floor, so on this evidence nothing has changed.
  • Supported: the 30 line has not been relevant for four months and is not relevant now. A rule waiting for oversold on this instrument has been waiting since the trend began.
  • Not supported: that 47 is a buy because it is "near support". The band is a description of what has happened, not a level with a mechanism behind it, and bands shift without notice, which is precisely the event worth watching for.

Where it misleads

Known failure modes
SituationWhat goes wrong
Strong trendThe line parks above 70 or below 30 for weeks; crossings produce a stream of losing counter-trend trades.
Read as relative to other stocksNothing external enters the calculation. RSI is not a ranking measure, whatever the name suggests.
Too little dataWilder smoothing carries the whole series; a short history gives a reading that depends on its start date.
Unadjusted pricesA split or large dividend creates one enormous "loss" that distorts the average across the whole window.
Period shoppingTrying 7, then 9, then 21 until a signal appears fits the indicator to the past.

What volume adds

RSI looks at one input: the closing price. It cannot distinguish a two-per-cent advance that absorbed heavy selling from one that drifted up on nothing, and both produce the same reading. That is the specific gap volume fills, and it is why a divergence confirmed by thinning volume into the second high is a materially stronger observation than the same divergence alone. One instrument disagreeing with itself is weak evidence; two independent measurements agreeing is the most this field offers.

Frequently asked questions

What does RSI actually measure?

The size of recent gains relative to the size of recent losses, expressed on a bounded 0–100 scale. That is a narrower claim than it is usually given credit for. It is not a measure of strength against other stocks — despite the name, nothing outside the instrument enters the calculation — and it is not a measure of value or of how far price has travelled. Two instruments with the same RSI have the same balance of recent up moves to down moves and may have moved by wildly different amounts.

Why 14 periods?

Wilder used 14 in New Concepts in Technical Trading Systems in 1978 and offered no statistical derivation for it; it was roughly half a lunar month of trading and it worked on the data he had. It has become self-reinforcing since: 14 is the default on nearly every platform, so a great many participants are watching the same line, which is a real reason to keep it. Shorter periods react faster and produce far more extreme readings; longer ones are steadier and later.

Is a reading above 70 a sell signal?

No, and treating it as one is the most expensive common mistake with this indicator. In a strong trend RSI can hold above 70 for weeks while price continues to rise. What overbought means is that recent gains have been large relative to recent losses, a statement about momentum, not about what happens next. In a range the levels mark useful edges; in a trend they mark the middle of the move.

What is Cutler’s RSI?

A variant that averages the gains and losses with a simple moving average instead of Wilder’s smoothing. It produces a slightly different line and, more importantly, a line that does not depend on how far back the data starts, a simple average of the last n values forgets everything older, while Wilder’s carries the whole history forward at decreasing weight. Cutler’s is therefore reproducible from a short series, which is why it appears in spreadsheets and academic work. It is not the standard, and mixing the two silently is one of the ways platforms disagree.

Do the ranges shift in a trend?

Yes, and it is the most useful under-documented observation about this indicator. In a sustained uptrend RSI tends to oscillate roughly between 40 and 80, using the 40 area as support rather than the 30 line; in a downtrend it works between about 20 and 60, with 60 acting as the ceiling. Andrew Cardwell documented the behaviour. The practical consequence is that a fall to 40 in an uptrend is a different event from a fall to 40 in a range. In one it is the bottom of the working band, in the other it is unremarkable.

What is a failure swing?

Wilder’s own construction, and stricter than a divergence. A bearish failure swing is RSI making a high above 70, pulling back, then making a lower high that fails to exceed the first, and finally breaking below the low of the pullback. The break is the trigger; everything before it is setup. Because it requires a specific completed sequence rather than a visual impression, it is far harder to imagine into a chart than a divergence is, which is its main advantage.

Is RSI useful on weekly or monthly charts?

The arithmetic is identical and the readings behave more cleanly, because there is less noise for the smoothing to work through. What changes is the meaning of the period: RSI(14) on a monthly chart spans more than a year of data, so it turns rarely and describes something closer to a multi-year cycle than to a trade. Comparing a weekly reading with a daily one from the same instrument is comparing two different questions.

How do I tell a real divergence from noise?

Three things separate the ones worth noting. First, the price extremes being compared should be meaningful swing points, not any two adjacent bars. Second, the gap should be visible without measuring, if you need calipers, it is not a divergence. Third, and most usefully, it should agree with something independent: volume thinning into the second high, or breadth failing to confirm it. A divergence that only exists in the oscillator is one instrument disagreeing with itself.

Why does RSI hit 100 or 0 so rarely?

Because both require an unbroken run. RSI reaches 100 only when the average loss over the whole smoothing window is zero, every bar up, with no exceptions, for long enough that the smoothed average of losses decays to nothing. A single down bar restores it. The bounded scale is therefore compressed in practice: readings above 90 or below 10 are rare on liquid instruments and usually indicate an unusual sequence rather than an unusual magnitude.

Does the period change what the levels mean?

Substantially, and it is the reason period-shopping is so tempting. A shorter period reaches 70 and 30 far more often, because fewer bars enter each average and a run of three or four moves the reading a long way. RSI(7) above 70 is a weekly occurrence; RSI(21) above 70 is not. Any threshold discussion that does not state the period is incomplete.

Can I use RSI to compare two stocks?

For the level, yes, that is what being bounded buys you, and it is the property PMO and MACD lack. Both at 75 have had a comparably one-sided run of gains against losses. What you cannot infer is that they moved by comparable amounts: a stock that rose two per cent on twelve of fourteen days and one that rose twenty per cent on the same pattern produce similar readings. The scale measures consistency, not magnitude.

What happens after a stock split or a large dividend?

Unadjusted data produces one enormous "loss" on the ex-date, which enters the average and distorts every reading until the smoothing works it out, with Wilder smoothing, that is a long tail rather than a clean exit after n bars. Always use adjusted prices. If a reading looks inexplicable, check the corporate-action history before checking the indicator.

Is RSI(2) a real technique or a curiosity?

A real one, and it works differently enough to deserve its own name. At two periods the indicator is almost pure short-term noise, spending most of its time at one extreme or the other, and the mean-reversion systems built on it use readings below 5 or above 95 rather than 30 and 70. Whether it holds up is a separate question; what matters here is that it is not RSI(14) with a different number. The behaviour is qualitatively different and the thresholds are not transferable.

Why is it called relative strength if nothing external is involved?

A naming collision that has caused confusion since 1978. In portfolio analysis "relative strength" means one instrument measured against another or against an index, the basis of relative-strength ranking and of the ratio charts fund managers use. Wilder’s index compares an instrument only with its own recent history. The two are unrelated methods with the same name, and reading RSI as a cross-instrument measure is the direct result. Where a source means the portfolio sense it usually says "relative strength line" or "RS ratio"; where it means this one it says RSI.

Should the FAQ answer be that RSI predicts reversals?

No, and it is worth being blunt because the claim is everywhere. RSI is a transformation of past closing prices; it contains no information the prices do not, and no arrangement of them predicts anything. What it does is compress a run of behaviour into a number that is comparable across time and across instruments, which makes certain patterns (persistent one-sidedness, weakening pushes) easier to see. Seeing them earlier is worth something. Forecasting is a different claim entirely.