← Back to Home
Trading Signal / Indicator
🔋

Relative Strength Index (RSI)

Measure momentum and identify overbought/oversold conditions.

Start Automating Free →

Want to automate this strategy? Try auto-Trading free — no credit card required.

Relative Strength Index (RSI) chart

Overview

What is Relative Strength Index (RSI)?

The Relative Strength Index (RSI) is a momentum oscillator developed by J. Welles Wilder Jr. and introduced in his 1978 book "New Concepts in Technical Trading Systems." It measures the speed and magnitude of recent price changes to evaluate overbought or oversold conditions on a scale of 0 to 100.

The standard calculation uses 14 periods: RSI = 100 − (100 ÷ (1 + RS)), where RS is the average of up-closes divided by the average of down-closes over 14 periods. A reading above 70 is traditionally considered overbought (potential reversal down), and below 30 is considered oversold (potential reversal up).

RSI divergence is one of the most powerful signals in technical analysis. Bullish divergence occurs when price makes a lower low but RSI makes a higher low — indicating waning bearish momentum and a potential reversal up. Bearish divergence is the opposite. These divergences often precede significant trend reversals and are most reliable on higher timeframes (4H, daily).

RSI can also be used in trending markets by adjusting the overbought/oversold thresholds: in uptrends, use 40 as oversold (instead of 30) and 80 as overbought; in downtrends, use 60 as overbought. This avoids the common mistake of shorting strong uptrends just because RSI reads above 70.

How It Works in auto-Trading

Automate It

auto-Trading computes RSI in real time on any timeframe. The strategy builder supports RSI threshold signals (above/below a level), RSI crossovers (crossing the 50 midline for trend bias), and divergence detection (comparing RSI peaks and troughs with price peaks and troughs over a configurable lookback). Each signal type can be combined with other indicators for high-confluence entries.

Try Free →

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script example for this indicator. Paste it into the TradingView Pine Editor, add it to your chart, and adjust inputs for your market and timeframe.

//@version=6
strategy("Relative Strength Index (RSI)", overlay=true)
rsiLen = input.int(14, "RSI Length")
oversold = input.int(30, "Oversold")
overbought = input.int(70, "Overbought")

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript example for this indicator. Open thinkorswim, create a custom study, paste the script, and apply it to your chart.

input length = 14;
def r = RSI(length = length);
def buySignal = r crosses above 30;
def sellSignal = r crosses below 70;
AddOrder(OrderType.BUY_AUTO, buySignal, close, 1, Color.GREEN, Color.GREEN, "RSI Buy");

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Relative Strength Index (RSI)?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free →

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators