Relative Strength Index (RSI)
Introduction
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. Developed by J. Welles Wilder Jr. in 1978, the RSI is primarily used to identify overbought and oversold conditions in a market, helping traders make informed decisions about potential reversals.
Calculation of RSI
The RSI is calculated using the following steps:
Calculate the Average Gain and Average Loss:
- Average Gain = (Sum of Gains over n periods) / n
- Average Loss = (Sum of Losses over n periods) / n
Calculate the Relative Strength (RS):
- Calculate the RSI:
Where n
is typically set to 14 periods.
Example Calculation
Assume we have the following closing prices for a stock over 14 days:
Day | Closing Price |
---|---|
1 | $44 |
2 | $46 |
3 | $45 |
4 | $47 |
5 | $48 |
6 | $50 |
7 | $49 |
8 | $51 |
9 | $50 |
10 | $52 |
11 | $51 |
12 | $53 |
13 | $54 |
14 | $56 |
Calculate Daily Gains and Losses:
Days with gains:
- Day 2: $46 - $44 = $2
- Day 4: $47 - $45 = $2
- Day 5: $48 - $47 = $1
- Day 6: $50 - $48 = $2
- Day 8: $51 - $49 = $2
- Day 10: $52 - $50 = $2
- Day 12: $53 - $51 = $2
- Day 13: $54 - $53 = $1
- Day 14: $56 - $54 = $2
Days with losses:
- Day 3: $45 - $46 = -$1
- Day 7: $49 - $50 = -$1
- Day 9: $50 - $51 = -$1
- Day 11: $51 - $52 = -$1
Calculate Average Gain and Average Loss:
- Average Gain = (2 + 2 + 1 + 2 + 2 + 2 + 2 + 1 + 2) / 14 ≈ 1.43
- Average Loss = (1 + 1 + 1 + 1) / 14 ≈ 0.29
Calculate RS:
- Calculate RSI:
Python Code
Interpretation of RSI
- Overbought Conditions: An RSI above 70 generally indicates that the asset is overbought and may be due for a price correction.
- Oversold Conditions: An RSI below 30 indicates that the asset is oversold and might be undervalued, suggesting a potential buying opportunity.
- Divergence: When the price moves in the opposite direction of the RSI, it may signal an impending reversal.
Analogy
Think of the RSI like a temperature gauge for a bullish or bearish market. A temperature reading above 70 degrees represents a hot market (overbought), where traders might consider it too hot to handle. Conversely, a reading below 30 degrees indicates a cold market (oversold), where things may be undervalued and could warm up soon. Just as a temperature gauge helps us understand whether we need to bundle up or cool down, the RSI helps traders assess market conditions and make informed decisions.
Conclusion
The Relative Strength Index is a valuable momentum indicator that provides insights into price trends, potential reversals, and market conditions. By understanding and applying the RSI, traders can make better-informed trading decisions.
References
- Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
- Investopedia: Relative Strength Index (RSI)
- TradingView: Relative Strength Index