What is RSI?
The Relative Strength Index (RSI) is a momentum oscillator developed by J. Welles Wilder in 1978. It measures the speed and magnitude of recent price changes on a scale from 0 to 100, helping traders identify overbought and oversold conditions.
RSI answers the question: "How strong is the current price movement compared to recent history?"
How RSI is Calculated
The calculation uses average gains and average losses over a lookback period (default: 14):
RS = Average Gain / Average Loss
RSI = 100 - (100 / (1 + RS))
The first calculation uses a simple average. Subsequent calculations use a smoothed average (Wilder's smoothing), which means older data gradually fades but never completely disappears. This is why RSI behaves slightly differently than a raw gain/loss ratio.
Reading RSI Signals
Overbought (RSI above 70): The asset has been rising strongly and may be due for a pullback or reversal. This does not mean "sell immediately" — in strong uptrends, RSI can stay above 70 for extended periods.
Oversold (RSI below 30): The asset has been falling sharply and may be due for a bounce. Similarly, in strong downtrends, RSI can remain below 30 for a long time.
Centerline (50): RSI above 50 indicates bullish momentum; below 50 indicates bearish momentum. Some traders use the 50 line as a trend filter.
Overbought does not mean "sell" and oversold does not mean "buy." RSI works best as confirmation alongside trend analysis and price action. Trading RSI signals alone in trending markets leads to consistent losses.
RSI Divergence — The Most Powerful Signal
Divergence occurs when RSI and price move in opposite directions. It is one of the most reliable reversal signals in technical analysis:
Bullish Divergence: Price makes a lower low, but RSI makes a higher low. This means selling momentum is weakening even though price is still falling — a potential reversal upward.
Bearish Divergence: Price makes a higher high, but RSI makes a lower high. Buying momentum is fading despite higher prices — a potential reversal downward.
Divergences are most reliable when they occur at extreme RSI levels (above 70 or below 30) and on higher timeframes (H4, D1).
RSI Period Settings
- RSI 14 (default) — Balanced between sensitivity and reliability. Suitable for most timeframes and instruments.
- RSI 7-9 (short period) — More sensitive, generates more signals but more false ones. Useful for short-term scalping on lower timeframes.
- RSI 21-25 (long period) — Smoother, fewer signals but more reliable. Better for swing trading and position trading.
Advanced RSI Techniques
RSI Trendlines: You can draw trendlines directly on the RSI indicator. A trendline break on RSI often precedes a price breakout.
RSI Range Shift: In bull markets, RSI tends to oscillate between 40-80 (not 30-70). In bear markets, it shifts to 20-60. Adjusting your overbought/oversold levels to match the trend improves signal quality.
Multi-timeframe RSI: Check RSI on a higher timeframe for the trend, then use a lower timeframe RSI for entries. For example, only take buy signals on M15 RSI when H4 RSI is above 50.
RSI in MQL5
In MQL5, RSI is accessed through the iRSI() function:
int rsiHandle = iRSI(_Symbol, PERIOD_CURRENT, 14, PRICE_CLOSE);
double rsiBuffer[];
CopyBuffer(rsiHandle, 0, 0, 3, rsiBuffer);
// rsiBuffer[0] = most recent RSI value
This is useful when building Expert Advisors that need to make decisions based on RSI levels. We cover this in the MQL5 Programming section.