The SuperTrend - RSI Trading Strategy
What if we Combine to Powerful Indicators in a Simple Trading Strategy?
Combining powerful indicators can sometimes be tricky as they can sometimes be non-compatible. This article discusses two complementary indicators, the famous RSI and the SuperTrend, a new disruptor in the world of technical analysis.
The RSI in a Nutshell
The relative strength index (RSI), developed by J. Welles Wilder Jr. in 1978, is a momentum oscillator designed to measure the speed and magnitude of recent price changes. It captures whether a security is overbought or oversold, providing insight into potential reversal zones or confirmation of trends. Unlike the MACD, which is unbounded and centered around zero, RSI is bounded between 0 and 100, which makes it ideal for identifying extremes in price movement.
The RSI’s core concept is simple: compare average gains to average losses over a specified lookback period, usually 14 periods. If prices have mostly risen during that period, the RSI moves toward 100; if they’ve mostly fallen, the RSI approaches 0.
To construct the RSI, we begin with the basic notion of relative strength — not in a physical sense, but the ratio of bullish to bearish movement in price. Given a series of closing prices P​, we compute the price change:
This change is decomposed into two parts:
The upward move (gain).
The downward move (loss).
These values are then smoothed, not simply averaged. Wilder used a type of exponential smoothing in his original formulation, which is a recursive formula similar to EMA:
With these averages, we define the relative strength (RS):
Finally, the RSI itself is calculated by normalizing RS into a 0–100 range:
This formulation ensures that when gains dominate, RS > 1 and RSI moves toward 100; when losses dominate, RS < 1 and RSI falls toward 0.
The RSI is traditionally used to identify overbought or oversold conditions. The key levels are:
RSI > 70: asset may be overbought.
RSI < 30: asset may be oversold.
However, interpreting RSI requires more than just these thresholds.
First, let’s consider what "overbought" and "oversold" truly mean. Overbought does not mean the price will immediately fall — it means the price has risen strongly, and a correction could be near. Likewise, oversold means a strong decline has occurred, not that a rebound is guaranteed. In strong trends, RSI can stay overbought or oversold for long periods. This is where RSI becomes more useful in confirming momentum rather than calling reversals. For example, if RSI remains above 70 during an uptrend, it confirms strength — not necessarily a reason to sell.
Check out my newsletter that sends weekly directional views every weekend to highlight the important trading opportunities using a mix between sentiment analysis (COT report, put-call ratio, etc.) and rules-based technical analysis.
The SuperTrend in a Nutshell
The SuperTrend indicator is a popular trend-following technical indicator used by traders to identify the direction of the market and generate buy or sell signals. It’s built on two key components: average true range (ATR) and a multiplier.
The ATR is a technical indicator developed by J. Welles Wilder Jr., first introduced in his 1978 book. Wilder created the ATR to analyze commodity markets, which often had high volatility and frequent gaps. The goal was to build a more accurate picture of daily price movement than simply looking at the high-low range. The ATR solves this by factoring in gaps and limit moves that can distort traditional volatility measurements. The first step is calculating the true range (TR). It’s the greatest of:
Current high minus current low.
Absolute value of current high minus previous close.
Absolute value of current low minus previous close.
This catches gaps and sudden jumps that a high-low range would miss. Once you have the true range values over a set period (commonly 14 days), you average them to get the ATR.
At its core, the SuperTrend indicator creates a trend line that either sits below price (in an uptrend) or above price (in a downtrend). This line shifts when there's a reversal based on price crossing a threshold calculated from volatility. The SuperTrend "flips" when the closing price crosses the bands.
Creating the Strategy
The strategy uses a 5-period RSI and a 21-period SuperTrend, where the former times the reversal and the latter confirms the trend and the support/resistance area. Here’s how:
A bullish signal is generated whenever the market is in an uptrend confirmed by the SuperTrend and is back around the support level (ideally flat). At the same time, the 5-period RSI must be below 30.
A bearish signal is generated whenever the market is in a downtrend confirmed by the SuperTrend and is back around the resistance level (ideally flat). At the same time, the 5-period RSI must be above 70.
The following chart shows an example of bullish signals.
The following chart shows bearish signals.
Use the following PineScript code to visualize the strategy on TradingView:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar
//@version=6
indicator("Supertrend-RSI", overlay = true)
atrPeriod = input.int(21, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
supertrend := barstate.isfirst ? na : supertrend
lookback = input(defval = 5, title = 'Lookback')
rsi = ta.rsi(close, lookback)
buy = close > supertrend and rsi < 30 and rsi[1] > 30
sell = close < supertrend and rsi > 70 and rsi[1] < 70
plotshape(buy, style = shape.triangleup, color = color.green, location = location.belowbar, size = size.small)
plotshape(sell, style = shape.triangledown, color = color.red, location = location.abovebar, size = size.small)
The following chart shows the result of the code. You can tweak the parameters as you see fit.