Relative Strength Index
Measures the speed and magnitude of recent price changes to identify overbought and oversold conditions on a 0–100 scale.
Overview
The Relative Strength Index (RSI) was developed by J. Welles Wilder Jr. and published in 1978. It is one of the most widely used technical indicators worldwide, measuring the velocity of price changes to determine whether an asset is overbought (likely to pull back) or oversold (likely to bounce). RSI oscillates between 0 and 100, with traditional thresholds at 70 (overbought) and 30 (oversold).
How it looks on a chart
Illustration only — synthetic data generated for visual reference.
RSI tells you how fast and how much prices have been rising or falling compared to recent history. A reading above 70 suggests the asset has risen very quickly and may be "overbought" — meaning buyers have pushed it too far, too fast, and a pullback could be coming. A reading below 30 suggests it has fallen sharply and may be "oversold" — sellers have pushed it very far and a bounce might be near. The RSI stays between 0 and 100. A reading of 50 means buying and selling pressure are roughly equal. When RSI is consistently above 50, the asset tends to be in an uptrend. When consistently below 50, a downtrend. Divergence is RSI's most powerful signal. If the price keeps making new highs but RSI makes lower highs, this bearish divergence warns that the rally is losing steam. If price makes new lows but RSI makes higher lows, this bullish divergence suggests the sell-off is weakening. These are among the highest-quality signals RSI generates.
RSI is calculated using Wilder's smoothed average of gains and losses over 14 periods. RS = Average Gain / Average Loss, then RSI = 100 − (100 / (1 + RS)). The first average is a simple average of the first 14 periods; subsequent values use Wilder's smoothing: Smoothed Avg = (Prior Avg × 13 + Current Value) / 14. For swing trading on daily charts, RSI(14) with 70/30 thresholds is standard. Shorter periods like RSI(9) or RSI(7) are more sensitive and suit intraday traders; longer periods like RSI(21) are smoother and used for weekly trend confirmation. In strong uptrends, RSI often oscillates between 40–90 rather than hitting 30, making the 50 level more relevant as support. Combining RSI with trend direction is crucial. Taking oversold RSI signals only in uptrends (price above 200 MA) and overbought signals only in downtrends transforms RSI from a reversal indicator into a trend-continuation entry tool — often with better win rates.
Connors RSI (CRSI) extends the standard RSI by combining three components: RSI(3) on price, the streak RSI (how many days up/down in a row), and a percentile rank of the 1-day rate of change. This multi-factor approach reduces false signals and is specifically designed for short-term mean-reversion strategies. In quantitative research, RSI-based mean reversion on short horizons (2–5 days) has been systematically documented (Connors & Alvarez 2009, Clenow 2012). The strategy of buying when RSI(2) drops below 5 and selling when it rises above 95 in S&P 500 stocks achieved very high win rates historically, though with clustering of losses during trend-following environments. A critical implementation note: Wilder's smoothing creates a long initialization period. The true RSI value at bar T depends theoretically on all prior bars since inception. In practice, 100+ warm-up bars are needed for stable RSI values. Gilito enforces this warm-up window in all backtests to avoid misleading results from the initialization phase.
Formula
RSI = 100 − (100 / (1 + RS)) RS = Average Gain(14) / Average Loss(14)
- 1.For each of the last 14 periods, calculate the gain (if close > prev close) or loss (if close < prev close).
- 2.First Average Gain = sum of gains over 14 periods / 14; First Average Loss = sum of losses / 14.
- 3.Subsequent values: Avg Gain = (Prev Avg Gain × 13 + Current Gain) / 14 (Wilder's smoothing).
- 4.Compute RS = Average Gain / Average Loss.
- 5.Compute RSI = 100 − (100 / (1 + RS)); values range from 0 to 100.
Parameters
| Parameter | Default | Range | Description |
|---|---|---|---|
| Period | 14 | 2–50 | Number of bars for averaging gains and losses. |
| Overbought Level | 70 | 60–85 | RSI level above which the asset is considered overbought. |
| Oversold Level | 30 | 15–40 | RSI level below which the asset is considered oversold. |
Trading signals
bullish: RSI crosses below 30 (oversold)
Potential reversal or bounce — selling pressure may be exhausting.
bearish: RSI crosses above 70 (overbought)
Potential pullback — buying pressure may be exhausting.
bullish: Bullish divergence: lower price lows with higher RSI lows
Selling momentum weakening despite lower prices — reversal likely.
bearish: Bearish divergence: higher price highs with lower RSI highs
Buying momentum fading at higher prices — reversal likely.
Limitations
- •Can remain overbought or oversold for extended periods in strongly trending markets.
- •Divergence signals can fail multiple times before a reversal actually occurs.
- •Parameter choice (period, thresholds) is subjective and often optimized in-sample.
- •Does not account for volume, so a rapid price move on thin volume looks identical to one on heavy volume.
Gilito backtests RSI across periods from 2 to 50 and overbought/oversold thresholds from 20/80 to 40/60, evaluating both mean-reversion and trend-continuation applications. RSI(2) short-term mean reversion is one of the most-tested strategy archetypes in its engine, systematically evaluated on every equity, ETF, and futures contract in its universe.