# RSI

Also known as: Cutler's RSI, smoothed variants.
A Momentum & Oscillators concept (RSI family) in the LuxAlgo Library, with 54 indicator implementations.

## What is RSI?

RSI, the Relative Strength Index, is a bounded momentum oscillator introduced by J. Welles Wilder in his 1978 book New Concepts in Technical Trading Systems. It measures the speed and magnitude of recent price changes by comparing average gains to average losses over a lookback window, 14 periods by default, and maps the result onto a 0-100 scale. When every bar in the window closed higher, the reading approaches 100; when every bar closed lower, it approaches 0.

The conventional grammar: readings above 70 are called [overbought](https://www.luxalgo.com/library/concept/overbought-oversold/), readings below 30 oversold, and the 50 level splits the scale. Wilder's own signals went further: [failure swings](https://www.luxalgo.com/library/concept/rsi-failure-swing/), where RSI reverses from an extreme and breaks its own pivot without reference to price, and [divergence](https://www.luxalgo.com/library/concept/regular-bullish-bearish-divergence/) between price extremes and RSI extremes. Later work added [range rules](https://www.luxalgo.com/library/concept/rsi-range-rules/): in uptrends RSI tends to hold roughly 40 to 80, in downtrends roughly 20 to 60, so the same number reads differently by regime.

RSI matters because its normalized scale made momentum comparable across any instrument and timeframe, which is why it became one of the most widely used oscillators on charting platforms and the base layer for a family of derivatives, from [Stochastic RSI](https://www.luxalgo.com/library/concept/stochastic-rsi/) to short-lookback mean-reversion variants. Much of the oscillator vocabulary traders use daily was standardized on RSI first.

## How to calculate RSI

RSI is fully specified by a lookback and a smoothing choice; the arithmetic below is Wilder's original.

1. Separate gains from losses. Over the lookback (14 by default), take each bar's change from the prior close; up moves count toward average gain, down moves (taken as positive numbers) toward average loss.
2. Smooth with Wilder's method: seed each average with a simple mean, then blend each new bar in at a weight of 1/length (an RMA, an EMA-type recursion with alpha of 1/length). Cutler's variant uses a simple moving average instead, which is why values differ slightly across platforms.
3. Form the ratio and rescale. RS equals average gain divided by average loss, and RSI equals 100 minus 100/(1 + RS). If the average loss is zero, RSI reads 100.
4. Read it on the 0-100 scale: 70/30 are the conventional overbought/oversold lines, 50 the momentum midline, and many chartists mark 80/20 for stricter extremes.

## How it's calculated

RSI compares the average size of recent gains to recent losses and maps the result onto a 0 to 100 scale.

```
U_t = max(C_t - C_{t-1}, 0)
D_t = max(C_{t-1} - C_t, 0)
Seed: AvgU_n = (Σ U_i over i = 1..n) / n
Seed: AvgD_n = (Σ D_i over i = 1..n) / n
After the seed: AvgU_t = (AvgU_{t-1} × (n - 1) + U_t) / n
AvgD_t = (AvgD_{t-1} × (n - 1) + D_t) / n
RS_t = AvgU_t / AvgD_t
RSI_t = 100 - 100 / (1 + RS_t)

  C_t: close of bar t
  t: bar index
  U_t: gain of bar t (0 on a down bar)
  D_t: loss of bar t as a positive number (0 on an up bar)
  n: lookback length (commonly 14)
  i: bar index inside the seed window
  AvgU_t: average gain (simple average seed, then Wilder smoothing)
  AvgD_t: average loss (simple average seed, then Wilder smoothing)
  RS_t: relative strength ratio
  RSI_t: RSI value on a 0 to 100 scale
```

The smoothing above is Wilder's (RMA), per the original 1978 definition; Cutler's RSI uses simple moving averages of U and D instead, and some platforms offer EMA smoothing, which shifts values slightly.

Equivalently RSI_t = 100 × AvgU_t / (AvgU_t + AvgD_t), which also covers the AvgD_t = 0 case (RSI = 100).

## How traders use it

- As a stretch gauge with regime awareness: 70/30 tags are commonly faded in ranges, but in a strong trend RSI can sit above 70 for extended stretches, so an overbought reading is context, not a standalone sell signal.
- For divergence and failure swings: a new price high against a lower RSI high (or the mirror at lows) flags fading momentum, and a failure swing confirms it internally when RSI breaks its own prior pivot.
- As a regime line: crossing and holding either side of 50 marks the [centerline regime](https://www.luxalgo.com/library/concept/centerline-regime/), and the 40-80 versus 20-60 range rules help classify whether a market is in an uptrend or downtrend leg.
- As raw material: RSI is itself an input to derivative tools (a stochastic applied to RSI, bands drawn on RSI, RSI computed on volume or other sources), and short-lookback versions drive mean-reversion rules.

## RSI vs related oscillators

- **Stochastic Oscillator** (https://www.luxalgo.com/library/concept/stochastic-oscillator/): Both are bounded 0-100, but the stochastic locates the close within the recent high-low range while RSI compares average gains to average losses. The stochastic is choppier and reaches extremes more readily; RSI moves more slowly and holds trending readings longer.
- **Stochastic RSI** (https://www.luxalgo.com/library/concept/stochastic-rsi/): An oscillator of an oscillator: the stochastic formula applied to RSI values rather than price. It is far more sensitive and pins to 0 or 100 quickly. It measures where RSI sits within its own recent range, which is not the same information RSI gives.
- **MACD** (https://www.luxalgo.com/library/concept/macd/): MACD is an unbounded difference of two EMAs, scaled in price units, so it reads trend direction and strength. RSI is bounded and normalized, so it reads stretch. MACD suits trend confirmation; RSI suits overbought/oversold and divergence work.
- **Money Flow Index** (https://www.luxalgo.com/library/concept/money-flow-index/): MFI runs the same ratio-and-rescale construction on volume-weighted money flow instead of close-to-close change. It is often described as a volume-weighted RSI, and the two diverge where volume disagrees with price movement.

## FAQ

### What is the best RSI setting?

Wilder's default is 14 periods, and there is no universally better number. Short lookbacks such as the 2-period version behind [RSI-2](https://www.luxalgo.com/library/concept/rsi-2/) mean-reversion rules react fast and spend far more time at extremes; longer lookbacks smooth the line and produce fewer, later signals. Match the setting to your holding period and signal logic rather than hunting a supposed optimum.

### Does RSI above 70 mean I should sell?

No. Above 70 means recent gains dominate recent losses, which is exactly what strong uptrends produce; RSI can hold above 70 while price keeps climbing. Overbought is a warning that a move is stretched, not a sell signal. Most approaches require confirmation, such as a divergence, a failure swing, or a break in price structure, before fading it.

### Why is my RSI different from another platform's?

Almost always the smoothing. Wilder's original uses his recursive smoothing (RMA); Cutler's variant uses a simple moving average of gains and losses. The two converge over long histories but differ after volatile stretches, and the recursive version's values also depend on where the calculation history starts. Same concept, slightly different arithmetic.

### Is RSI the same as relative strength?

No. RSI compares an instrument's own average gains to its own average losses. [Relative strength](https://www.luxalgo.com/library/concept/relative-strength-comparative/) in the comparative sense divides one instrument's price by another's, a stock versus its index for example, to measure outperformance. The shared name is a historical accident; the two answer different questions.

### What is an RSI failure swing?

Wilder's confirmation pattern, read entirely on the oscillator. Bearish case: RSI pushes above 70, pulls back, makes a lower high, then breaks below its own pullback low. The bullish case mirrors this below 30. Because it needs no reference to price, Wilder treated it as stronger evidence than an extreme reading alone.

## Implementations in the Library

- RSI Multi Length (LuxAlgo): https://www.luxalgo.com/library/indicator/rsi-multi-length/
- RSI Candlestick Oscillator (LuxAlgo): https://www.luxalgo.com/library/indicator/rsi-candlestick-oscillator/
- RSI Prediction by Range Segmentation (LuxAlgo): https://www.luxalgo.com/library/indicator/rsi-prediction-by-range-segmentation/
- RSI Divergence: Out-of-Sample Optimizer (LuxAlgo): https://www.luxalgo.com/library/indicator/rsi-divergence-out-of-sample-optimizer/
- Inertial RSI (LuxAlgo): https://www.luxalgo.com/library/indicator/inertial-rsi/
- Ultimate RSI (LuxAlgo): https://www.luxalgo.com/library/indicator/ultimate-rsi/
- Chaos Weighted RSI (LuxAlgo): https://www.luxalgo.com/library/indicator/chaos-weighted-rsi/
- Rainbow Adaptive RSI (LuxAlgo): https://www.luxalgo.com/library/indicator/rainbow-adaptive-rsi/
- Adaptive Bounds RSI (LuxAlgo): https://www.luxalgo.com/library/indicator/adaptive-bounds-rsi/
- Relative Strength Index (LuxAlgo — the standard build of the classic formula): https://www.luxalgo.com/library/indicator/relative-strength-index/

## Related concepts

- Adaptive/dynamic RSI: https://www.luxalgo.com/library/concept/adaptive-dynamic-rsi/
- Stochastic RSI: https://www.luxalgo.com/library/concept/stochastic-rsi/
- Connors RSI: https://www.luxalgo.com/library/concept/connors-rsi/
- RSI-2: https://www.luxalgo.com/library/concept/rsi-2/
- Laguerre RSI: https://www.luxalgo.com/library/concept/laguerre-rsi/
- RSI Bands: https://www.luxalgo.com/library/concept/rsi-bands/
- RSI of Other Sources: https://www.luxalgo.com/library/concept/rsi-of-other-sources/
- RSI Range Rules: https://www.luxalgo.com/library/concept/rsi-range-rules/
- RSI Failure Swing: https://www.luxalgo.com/library/concept/rsi-failure-swing/
- Cardwell Positive/negative Reversals: https://www.luxalgo.com/library/concept/cardwell-positive-negative-reversals/

---

Source: https://www.luxalgo.com/library/concept/rsi/ (LuxAlgo Library, the encyclopedia of trading & technical analysis). Free to use with attribution: https://www.luxalgo.com/library/license/