RSI Calculator
Calculate the Relative Strength Index (RSI), a momentum oscillator that measures the speed and magnitude of price movements. Identify overbought and oversold conditions to make informed trading decisions.
What is the Relative Strength Index (RSI)?
The Relative Strength Index (RSI) is a momentum oscillator developed by J. Welles Wilder Jr. in 1978 and introduced in his book "New Concepts in Technical Trading Systems." It measures the speed and magnitude of recent price changes to evaluate overbought or oversold conditions in the price of a stock or other asset.
RSI oscillates between 0 and 100, providing traders with signals about potential price reversals. It's one of the most popular and widely-used technical analysis indicators, employed by traders and investors across stocks, forex, cryptocurrencies, and other financial markets.
How RSI Works
The RSI compares the magnitude of recent gains to recent losses over a specified period (typically 14 periods). This comparison is expressed as a value between 0 and 100:
- RSI above 70: Generally indicates overbought conditions - the asset may be overvalued
- RSI below 30: Generally indicates oversold conditions - the asset may be undervalued
- RSI around 50: Indicates neutral momentum with no clear trend
The RSI Formula
The RSI is calculated using the following steps:
RSI = 100 - (100 / (1 + RS))
Where RS (Relative Strength) is:
RS = Average Gain / Average Loss
Step-by-Step Calculation
- Calculate Price Changes: Find the difference between each closing price and the previous day's closing price
- Separate Gains and Losses: Positive changes are gains; negative changes (as absolute values) are losses
- Calculate Average Gain: Sum of gains over the period divided by the period length
- Calculate Average Loss: Sum of losses over the period divided by the period length
- Calculate RS: Divide average gain by average loss
- Calculate RSI: Apply the RSI formula
Example Calculation
Given 14 days of price data with:
- Sum of gains: $6.30
- Sum of losses: $3.70
Average Gain: $6.30 / 14 = $0.45
Average Loss: $3.70 / 14 = $0.264
RS: 0.45 / 0.264 = 1.70
RSI: 100 - (100 / (1 + 1.70)) = 100 - 37.04 = 62.96
Interpreting RSI Signals
| RSI Value | Condition | Potential Signal |
|---|---|---|
| Above 80 | Strongly Overbought | High probability of price decline |
| 70 - 80 | Overbought | Consider selling or taking profits |
| 50 - 70 | Bullish Momentum | Uptrend may continue |
| Around 50 | Neutral | No clear directional bias |
| 30 - 50 | Bearish Momentum | Downtrend may continue |
| 20 - 30 | Oversold | Consider buying opportunity |
| Below 20 | Strongly Oversold | High probability of price rebound |
RSI Trading Strategies
1. Overbought/Oversold Strategy
The most basic RSI strategy involves buying when RSI drops below 30 (oversold) and selling when RSI rises above 70 (overbought). This works best in ranging markets without strong trends.
2. RSI Divergence
Divergence occurs when price and RSI move in opposite directions:
- Bullish Divergence: Price makes lower lows, but RSI makes higher lows - potential upward reversal
- Bearish Divergence: Price makes higher highs, but RSI makes lower highs - potential downward reversal
3. RSI Trendline Breaks
Draw trendlines on the RSI indicator itself. When RSI breaks through these trendlines, it often precedes price breakouts.
4. Failure Swings
A failure swing is a reversal signal that occurs when:
- Bullish Failure Swing: RSI drops below 30, rallies, pulls back (but stays above 30), then breaks above the prior high
- Bearish Failure Swing: RSI rises above 70, declines, rallies (but stays below 70), then breaks below the prior low
RSI Period Settings
The standard RSI period is 14, but traders often adjust this based on their trading style:
| Period | Sensitivity | Best For |
|---|---|---|
| 7 periods | High (more signals) | Short-term trading, scalping |
| 9 periods | Medium-High | Swing trading |
| 14 periods | Standard | General trading (recommended default) |
| 21 periods | Low (fewer signals) | Position trading, investing |
| 25+ periods | Very Low | Long-term trend analysis |
Limitations of RSI
- False Signals in Trends: During strong trends, RSI can stay overbought or oversold for extended periods
- Lagging Indicator: RSI is based on historical data and may not predict future movements accurately
- Context Matters: Different assets and market conditions may require adjusted RSI levels
- Whipsaws: In choppy markets, RSI can generate many false signals
Combining RSI with Other Indicators
For better accuracy, combine RSI with:
- Moving Averages: Use RSI for timing entries in the direction of the trend
- MACD: Confirm momentum signals with both indicators
- Support/Resistance: Look for RSI extremes near key price levels
- Volume: Confirm RSI signals with volume analysis
- Bollinger Bands: Use both for volatility and momentum analysis
Frequently Asked Questions
What timeframe should I use for RSI?
RSI can be applied to any timeframe - from 1-minute charts to monthly charts. Longer timeframes tend to produce more reliable signals but fewer trading opportunities.
Can RSI stay overbought/oversold for a long time?
Yes, especially during strong trends. In a powerful uptrend, RSI can remain above 70 for weeks or months. This is why RSI works better for timing in ranging markets.
Is RSI above 70 always a sell signal?
No. In strong uptrends, RSI above 70 might indicate strength rather than an imminent reversal. Consider the overall trend and use RSI for refinement rather than as a standalone signal.
What's the difference between RSI and Stochastic oscillator?
Both are momentum oscillators, but they calculate differently. RSI measures the speed of price changes, while Stochastic compares the closing price to the price range over a period. RSI is generally less sensitive to price swings.