RSI -- Relative Strength Index

Contents


Overview

The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and magnitude of recent price changes. It answers one question: how strong is the current move compared to recent moves?

RSI is calculated by comparing the average size of recent gains to the average size of recent losses over a lookback period. The result is normalized to a scale of 0 to 100:

  • RSI near 100 means almost all recent candles were bullish (strong upward momentum).
  • RSI near 0 means almost all recent candles were bearish (strong downward momentum).
  • RSI near 50 means gains and losses are roughly equal (no clear momentum).

The standard RSI period is 14, which looks at the last 14 candles. Shorter periods make RSI more reactive; longer periods make it smoother.

RSI(14) shown as oscillator below BTC/USDC 1h candle chart with zone labels

BTC/USDC 1-hour chart with RSI(14) displayed as a separate oscillator below the price chart. The horizontal lines at 70 (overbought) and 30 (oversold) mark the classic trading zones.


Format

rsi_{period}

The period defines how many candles RSI looks back to calculate average gains and losses.

ExamplePeriodUse Case
rsi_77Fast, reactive -- good for scalping on low timeframes
rsi_1414Standard -- the default for most strategies
rsi_2121Slower, smoother -- fewer false signals

Period range: 1 to 200.

Value range: 0 to 100 (always).


RSI Zones

RSI RangeZoneInterpretation
Below 30OversoldPrice has dropped sharply relative to recent history. Selling pressure may be exhausted. Potential buy opportunity.
30 -- 50Weak / NeutralBelow the midpoint. Momentum is bearish-leaning or undecided.
50 -- 70BullishAbove the midpoint. Momentum favors buyers. In a healthy uptrend, RSI typically stays in this range.
Above 70OverboughtPrice has risen sharply relative to recent history. Buying pressure may be exhausted. Potential sell opportunity or caution zone.

Note

"Oversold" and "overbought" do not mean price must reverse. In a strong trend, RSI can stay oversold or overbought for extended periods. RSI below 30 during a crash can stay there for days. Always combine RSI with other confirmations.


Understanding Operators with RSI

Each operator behaves differently with RSI. Understanding the distinction is critical for building strategies that fire when you intend.

< (Less Than) -- State-Based

What it does: The trigger is true on every candle where RSI is below the threshold.

On the chart: Imagine the RSI line sitting below the horizontal 30 line. For as long as the line stays below 30, this trigger is active. If RSI stays below 30 for eight consecutive candles, the trigger fires on all eight.

RSI dropping into the oversold zone below 30

RSI(14) dipping below the 30 threshold — the oversold zone highlighted in red. While RSI remains below 30, the < operator fires on every candle.

[[actions.triggers]]
indicator = "rsi_14"
operator = "<"
target = "30"

Warning

Because < fires on every qualifying candle, an "open_long" action with rsi_14 < 30 could attempt to open a new position on each candle where RSI remains below 30. Use max_count to limit this, or use cross_below if you only want the initial dip.

> (Greater Than) -- State-Based

What it does: The trigger is true on every candle where RSI is above the threshold.

On the chart: The RSI line is above the horizontal 70 line. Every candle it stays there, this trigger fires.

RSI rising into the overbought zone above 70

RSI(14) pushing above the 70 threshold — the overbought zone highlighted in orange. This is where selling pressure may start building.

[[actions.triggers]]
indicator = "rsi_14"
operator = ">"
target = "70"

Typical use: Sell when RSI is overbought. Combined with max_count = 1, it fires once when RSI first exceeds 70 and then stops.

cross_below -- Event-Based

What it does: Fires once, at the exact candle where RSI transitions from above the threshold to below it. The previous candle had RSI >= the target, and the current candle has RSI < the target.

On the chart: Picture the RSI line descending through the 70 line. The moment it pierces the line from above to below, this trigger fires -- and then goes silent until the next crossing.

RSI crossing below 70 — leaving overbought territory

RSI(14) crossing below the 70 threshold — the moment momentum starts fading. This event-based signal fires once at the crossing candle.

[[actions.triggers]]
indicator = "rsi_14"
operator = "cross_below"
target = "70"

Typical use: Detect when RSI "leaves overbought territory." This is often a stronger sell signal than simply being above 70, because it captures the turning point -- the moment momentum starts fading.

cross_above -- Event-Based

What it does: Fires once, at the exact candle where RSI transitions from below the threshold to above it. The previous candle had RSI <= the target, and the current candle has RSI > the target.

On the chart: The RSI line climbing up through the 30 line. The moment it crosses from below to above, the trigger fires once.

RSI crossing above 30 — recovery from oversold

RSI(14) crossing above the 30 threshold — recovery from oversold. Rather than buying while RSI is still falling, this waits for the first sign of recovery.

[[actions.triggers]]
indicator = "rsi_14"
operator = "cross_above"
target = "30"

Typical use: Detect when RSI "recovers from oversold." Rather than buying while RSI is still falling, this waits for the first sign of recovery -- RSI turning back up through 30.

Why: RSI produces floating-point values like 29.87 or 70.12. Exact equality (rsi_14 = 30) will almost never be true. Use < or > instead.

Choosing the right operator

  • Use < / > when you want to act while RSI is in a zone (state-based). Add max_count to limit repeated firing.
  • Use cross_above / cross_below when you want to act at the moment RSI enters or leaves a zone (event-based). No max_count needed -- crossovers fire once by nature.

TOML Examples

Buy on Oversold RSI

The simplest RSI strategy. Enter when RSI drops below 30 on the 1-hour chart.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "<"
  target = "30"
  timeframe = "1h"

Sell on Overbought RSI

Exit when RSI exceeds 70. The max_count = 1 ensures this only fires once per position.

[[actions]]
type = "sell"
amount = "100%"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = ">"
  target = "70"
  max_count = 1

Buy on RSI Recovery (Cross Above 30)

Instead of buying while RSI is still falling, wait for the first sign of recovery.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "cross_above"
  target = "30"
  timeframe = "1h"

Sell on Leaving Overbought (Cross Below 70)

Sell at the moment RSI drops back below 70 -- the overbought momentum is fading.

[[actions]]
type = "sell"
amount = "100%"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "cross_below"
  target = "70"
  timeframe = "1h"

StochRSI Extreme Dip

StochRSI is more sensitive than regular RSI and reaches extremes more often. This catches deep short-term dips.

[[actions]]
type = "open_long"
amount = "50 USDC"

  [[actions.triggers]]
  indicator = "stoch_rsi_14"
  operator = "<"
  target = "10"
  timeframe = "5m"
  max_count = 1

RSI with Trend Filter

Only buy RSI dips when the macro trend is bullish (daily SMA 50 above SMA 200).

RSI with trend filter — only buy dips in confirmed uptrends

Multi-timeframe confirmation: the daily SMA crossover confirms the macro uptrend, while the hourly RSI catches dip entries within that trend. This "trend-safe DCA" pattern avoids buying into falling markets.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "<"
  target = "35"
  timeframe = "1h"

  [[actions.triggers]]
  indicator = "sma_50"
  operator = ">"
  target = "sma_200"
  timeframe = "1d"

Tips

Period selection

Shorter periods (7, 9) make RSI oscillate faster between extremes. You get more signals, but more of them are false. Best suited for scalping on lower timeframes (1m, 5m).

Longer periods (21, 28) smooth out RSI and produce fewer, more reliable signals. Better for swing trading on higher timeframes (4h, 1d).

RSI(14) is the standard middle ground. Start here and adjust based on backtest results.

Combine with trend filters

RSI works best as a timing tool within a confirmed trend, not as a standalone signal. RSI < 30 in a strong downtrend is often a trap -- price can stay oversold for days. Pair RSI entries with a trend filter like sma_50 > sma_200 on the daily chart to avoid buying into falling markets.

Two-stage exits

A powerful pattern is to sell in stages: sell 50% at RSI > 50 (partial profit) and sell the remaining 100% at RSI > 70 (full exit). This captures more upside on strong bounces while locking in some profit early.

RSI vs. StochRSI

If you find RSI(14) too slow to reach extremes, try stoch_rsi_14. StochRSI applies the stochastic formula to RSI values, making it far more volatile -- it frequently hits 0 and 100. Use StochRSI for catching short-term dips on low timeframes; use RSI for broader momentum reads.