Why usFeaturesTemplatesBlogGlossary

Relative Strength Index (RSI)

A bounded oscillator that compares the size of a security's recent gains to the size of its recent losses, scaled to a 0 to 100 range.

RSI answers a narrow question: over the last N bars, how much of the total price movement was upward? J. Welles Wilder introduced it in 1978. In the expression language it is @RSI(close, 14).

How it is computed

RS = average gain over N bars / average loss over N bars

RSI = 100 - (100 / (1 + RS))

Wilder used a smoothed average rather than a plain mean, so each new bar updates the running gain and loss figures instead of dropping the oldest one. If every bar in the window rose, average loss is zero and RSI is 100. If every bar fell, RSI is 0. Equal average gain and loss gives 50.

The output is a pure number between 0 and 100 with no units, so it is compared to a threshold rather than to price:

@RSI(close, 14) < 30

Each expression is a single comparison, so a trend filter is a second rule in the pipeline rather than a longer string. Screening INFY for a pullback inside an uptrend means one rule holding @RSI(close, 14) < 30 and another holding close > @SMA(close, 200).

Typical parameters and thresholds

SettingConventionEffect
@RSI(close, 14)Wilder’s originalbalanced, the default in most software
@RSI(close, 7)shortermore readings at the extremes, more signals
@RSI(close, 21)longersmoother, fewer extreme readings
Below 30described as oversoldrecent losses have dominated
Above 70described as overboughtrecent gains have dominated

The 14-period window and the 30/70 lines are Wilder’s choices from a book about commodity futures. They are not optimal values for NSE equities, and nobody has shown that they are optimal anywhere.

Risks and caveats

@RSI(close, 14) < 30 does not mean a stock is cheap. It means the last 14 bars were mostly down bars. Those are different statements, and conflating them is the most common misuse of the indicator.

The honest failure mode is that RSI can stay below 30 for weeks while a stock keeps falling. In a genuine downtrend the oscillator pins near its floor and every “oversold” reading is another chance to buy into further decline. Indian investors saw this shape in YESBANK through 2019 and 2020. An RSI rule with no trend filter and no stop is a mechanism for catching falling knives.

The bounded scale also hides magnitude. A stock down 4% over 14 sessions and a stock down 40% can both print an RSI of 25, because the ratio is scale-free.

Tuning the window and both thresholds together gives you three free parameters over the same history. Search that grid hard enough and something will look excellent. That is overfitting, not evidence.

Back to Glossary