The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and magnitude of recent price changes on a scale from 0 to 100.
Formula
Average gain and average loss over period N use Wilder smoothing:
RS = AvgGain / AvgLoss
RSI = 100 − 100 / (1 + RS)
Typical settings
| Parameter | Common default |
|---|---|
| Period | 14 |
| Oversold | 30 |
| Overbought | 70 |
In strong trends, traders sometimes use 40/60 instead of 30/70 to reduce false mean-reversion signals.
How traders interpret RSI
- Below oversold — Market may be stretched to the downside (potential bounce in range markets).
- Above overbought — Market may be stretched to the upside.
- Divergence — Price makes a new high but RSI does not (or the reverse), hinting at weakening momentum.
RSI works best when combined with trend context; in a strong uptrend, “overbought” can persist for a long time.
In dogabot
The RSI trading rule emits:
- Buy when RSI is below the oversold level
- Sell when RSI is above the overbought level
Enable invert on the rule to flip buy/sell if you want the opposite behavior.
Example
With period 14, oversold 30, and overbought 70, suppose RSI prints 28 on the latest 4h candle. The RSI rule treats that as oversold and can emit a buy (unless blocked by filters). If RSI later reaches 72, the same rule would lean sell.