Relative Strength Index (RSI) Calculator

Category: Technical Analysis

Calculate RSI values to identify overbought and oversold conditions, divergence patterns, and potential market reversals

Price Data Input

Enter one price value per line, with most recent data at the top
Select a market to load sample data
Type of price data to use for RSI calculation

RSI Parameters

Number of periods for RSI calculation (standard is 14)
Method used to smooth gain/loss values
RSI value considered overbought (standard is 70)
RSI value considered oversold (standard is 30)
Method used to generate trading signals
Periods to check for divergence patterns

Understanding RSI (Relative Strength Index)

The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements on a scale from 0 to 100. It was developed by J. Welles Wilder Jr. and introduced in his 1978 book "New Concepts in Technical Trading Systems."

How RSI Works

RSI compares the magnitude of recent gains to recent losses to determine overbought and oversold conditions:

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

Where RS (Relative Strength) = Average Gain / Average Loss over a specified period.

  • RSI > 70: Traditionally considered overbought (potential sell signal)
  • RSI < 30: Traditionally considered oversold (potential buy signal)
  • RSI = 50: Centerline, can indicate momentum shifts when crossed

Interpreting RSI

  • Overbought/Oversold: Values above 70 indicate overbought conditions, while values below 30 indicate oversold conditions
  • Divergence: When price makes a new high/low but RSI doesn't confirm with its own new high/low, suggesting potential reversal
  • Failure Swings: When RSI crosses above 30 (bullish) or below 70 (bearish) after failed attempts to break these levels
  • Centerline Crossovers: RSI crossing above 50 can indicate bullish momentum, while crossing below 50 can indicate bearish momentum

RSI Trading Strategies

Overbought/Oversold Reversals

The classic approach is to sell when RSI moves above 70 (overbought) and buy when RSI drops below 30 (oversold). However, during strong trends, RSI can remain in overbought/oversold territory for extended periods.

Refinement: Wait for RSI to cross back below 70 or above 30 before taking action, confirming the reversal.

RSI Divergence

Bullish Divergence: Price makes lower lows while RSI makes higher lows, suggesting weakening downward momentum.

Bearish Divergence: Price makes higher highs while RSI makes lower highs, suggesting weakening upward momentum.

Divergences can be powerful signals of potential reversals, especially at market extremes.

Failure Swings

A bullish failure swing occurs when RSI moves below 30 (oversold), rallies above 30, pulls back without breaking below 30, then breaks its previous high.

A bearish failure swing occurs when RSI moves above 70 (overbought), drops below 70, rallies without breaking above 70, then breaks its previous low.

Centerline Crossovers

The 50 level on the RSI can act as support in bullish markets and resistance in bearish markets.

Buy when RSI crosses above 50 in an uptrend, sell when RSI crosses below 50 in a downtrend.

This approach is particularly useful for trend-following strategies.

Tips for Using RSI Effectively

  • Combine with other indicators - RSI works best when confirmed by other technical analysis tools like moving averages, MACD, or price patterns
  • Adjust time periods - Standard 14-period RSI works well for many situations, but shorter periods (e.g., 9) create more sensitive readings, while longer periods (e.g., 25) generate smoother readings with fewer signals
  • Respect the trend - During strong uptrends, RSI often remains above 40, while during strong downtrends, it often stays below 60
  • Watch for divergence - RSI divergence can be one of the most reliable indicators of potential trend reversals, especially at market extremes
  • Adapt overbought/oversold levels - In strong bull markets, adjust overbought to 80 and oversold to 40; in strong bear markets, adjust overbought to 60 and oversold to 20

What this calculates

RSI — the ratio of average gains to average losses, scaled 0–100.

Formula
RS = average gain over N ÷ average loss over N; RSI = 100 − (100 ÷ (1 + RS))
Worked example
Over 14 periods with an average gain of 0.8 and average loss of 0.4, RS = 2 and RSI = 100 − (100 ÷ 3) = 66.7.
When to use it
To gauge whether recent buying or selling pressure has been one-sided.
Common mistake
Above 70 does not mean sell. In a trend RSI can hold above 70 for weeks — treating it as an automatic reversal signal is the classic error.