Loading...
RSI is 0..100. Above 70 = overbought. Below 30 = oversold. The math is simpler than you'd think.
Over a rolling window (typically 14 bars):
1. Compute the bar-over-bar change: delta[i] = close[i] - close[i-1] 2. Split into gains (positive) and losses (absolute value of negative) 3. Compute average gain and average loss (Wilder's smoothing — like EMA) 4. RS = avg_gain / avg_loss 5. RSI = 100 - (100 / (1 + RS))
A strong uptrend can stay above 70 for weeks. "Overbought" ≠ "must reverse soon". Use RSI as one input, not a standalone signal.
Implement RSI(14) and compute the current RSI for BTC.