Technical Analysis · Momentum Indicators

The Complete RSI Guide
Beyond 30/70

2026-06-03·10 min read·Beginner to Intermediate

RSI (Relative Strength Index) is one of the most widely used indicators in technical analysis, invented in 1978 by J. Welles Wilder. Every textbook tells you "> 70 is overbought, < 30 is oversold," but that's just the entry point. This article covers the math, 4 advanced techniques, and Pine Script code — by the end you'll be able to write your own RSI strategy.

1. What Is RSI? The Math Behind It

RSI measures the ratio of upward force to downward force over the past N bars, outputting a value between 0 and 100. The default is N=14.

The Formula (no need to memorize — Pine computes it for you)

text
avg_gain = average of "gains" over the past 14 bars
avg_loss = average of "losses" over the past 14 bars

RS  = avg_gain / avg_loss
RSI = 100 - (100 / (1 + RS))

A few intuitions:

  • RSI = 50: gains and losses are balanced (neutral)
  • RSI > 70: gains far outweigh losses (potentially overbought)
  • RSI < 30: losses far outweigh gains (potentially oversold)
  • RSI = 100: every one of the past 14 bars was up — extreme
RSI 指標教學圖上方為價格 K 線,下方為 RSI 0-100 區間,標註 30 超賣 / 70 超買 兩條臨界線。當 RSI > 70 時 K 線轉跌,< 30 時轉漲。價格(K 線)RSI(0-100)70 超買30 超賣RSI > 70 → 隨後轉跌RSI < 30 → 隨後反彈
圖 1:RSI 超買(>70)後價格回跌、超賣(<30)後價格反彈的典型範例

2. The Beginner Play: Overbought / Oversold (Most Common, Most Dangerous)

The basic logic: RSI < 30 → oversold, possible bounce → buy; RSI > 70 → overbought, possible pullback → sell.

Why this often fails in crypto
Crypto runs one-way trends often. When BTC ripped from $30k to $60k, RSI parked above 80 the entire way up — anyone following "> 70, sell" got stopped out repeatedly. This approach works in range-bound markets; in a trend, it's a meat grinder.

Pine implementation (pure overbought/oversold — not recommended for live trading):

pine
//@version=5
strategy("RSI Overbought/Oversold (Teaching)", overlay=true)

length = input.int(14, "RSI Period")
oversold = input.int(30, "Oversold Value")
overbought = input.int(70, "Overbought Value")

rsi = ta.rsi(close, length)

if (ta.crossover(rsi, oversold))
    strategy.entry("Long", strategy.long)

if (ta.crossunder(rsi, overbought))
    strategy.entry("Short", strategy.short)

3. The Intermediate Play: Divergence (Where the Real Alpha Lives)

Divergence is where RSI really shines. It means price prints a new high/low, but RSI doesn't confirm it — a signal that momentum is fading.

Bullish Divergence (Buy Signal)

Price prints a lower low, but RSI prints a higher low. The downward force is weakening → a bounce often follows.

Bearish Divergence (Sell Signal)

Price prints a higher high, but RSI prints a lower high. The upward force is weakening → a pullback often follows.

Divergence works best on higher timeframes
Divergence signals on the 4-hour or daily are far more reliable than on the 5-minute. On the 5-minute, RSI can diverge 20 times a day — it's mostly noise.

4. The Advanced Play: The RSI 50 Midline as a Trend Filter

Most people overlook the 50 midline. In practice it's a quick-and-dirty trend direction check:

  • RSI consistently above 50 → uptrend
  • RSI consistently below 50 → downtrend
  • RSI repeatedly crossing 50 → ranging market

You can use it as a filter: only take long signals in an uptrend (RSI > 50), only take shorts in a downtrend. Pine:

pine
//@version=5
strategy("RSI 50 Trend Filter", overlay=true)

rsi = ta.rsi(close, 14)
emaFast = ta.ema(close, 9)
emaSlow = ta.ema(close, 21)

trendUp = rsi > 50  // RSI trend filter
trendDown = rsi < 50

// Long only on EMA golden cross + RSI > 50
if (ta.crossover(emaFast, emaSlow) and trendUp)
    strategy.entry("Long", strategy.long)

// Short only on EMA death cross + RSI < 50
if (ta.crossunder(emaFast, emaSlow) and trendDown)
    strategy.entry("Short", strategy.short)

5. The Pro Play: Dual-Timeframe (HTF) RSI

The idea: use a higher timeframe (e.g. daily) RSI to set the broader direction, and a lower timeframe (e.g. 1-hour) to time entries. Stop trading against the trend.

pine
//@version=5
strategy("HTF RSI Trend Filter", overlay=true)

// Current chart RSI (for entry execution)
rsi = ta.rsi(close, 14)

// Daily RSI (for trend judgment)
dailyRsi = request.security(syminfo.tickerid, "D", ta.rsi(close, 14))

longSignal = ta.crossover(rsi, 30) and dailyRsi > 50
shortSignal = ta.crossunder(rsi, 70) and dailyRsi < 50

if (longSignal)
    strategy.entry("Long", strategy.long)
if (shortSignal)
    strategy.entry("Short", strategy.short)

6. Where RSI Works Best — by Asset and Timeframe

Asset TypeTimeframeRSI Performance
BTC / ETH majors4h / D★★★★ Strong
BTC / ETH majors1m / 5m★★ Noisy
Stablecoin pairsD★★★★ Range-bound, overbought/oversold very reliable
Small altcoins (memecoins)Any★ Don't bother — pumps will steamroll you
Newly listed tokens (< 30 days)Any★ Not enough data — the readings are meaningless

7. Common Mistakes

❌ Fading a strong trend with overbought/oversold

In a bull market RSI parks at 80 and refuses to drop. If you sell at 70 you get stopped out, repeatedly. Fix: pair RSI with a trend filter (EMA 200 or the RSI 50 midline).

❌ Watching RSI without watching price structure

RSI is a momentum indicator, not a signal on its own. Read it alongside support/resistance, candlestick patterns, and volume. Entering on RSI alone wins about 50% of the time.

❌ Setting the period too short

Some traders crank the RSI period down to 5 to make it "more sensitive." The result: a flood of signals and a win rate that drops to 30%. Unless you really know what you're doing, leave it at the default 14.

❌ Looking at only one timeframe

The 5-minute RSI flashes oversold, but the daily is mid-downtrend — your bounce lasts one candle, then gets engulfed. Dual-timeframe analysis is the single biggest upgrade once you move past beginner.

Get started

Ready to ship what you just learned?

Wire your strategy to a TradingView webhook and auto-execute on Binance / OKX / Bybit and 4 more.

Start free trial

8. Wiring Today's Lesson Into an Auto-Trading Bot

Once your strategy is written, you can set TradingView Alerts and route them through TVSBot to auto-execute on your exchange. The full workflow is here: The Complete TradingView Webhook Guide.