RSI indicator: settings, divergence and alerts in SuperCharting
How to use the RSI indicator in SuperCharting: RSI Length, smoothing, the divergence option, 70/30 levels and setting an alert when RSI crosses a level.
The Relative strength index (RSI) measures how strong recent up moves are compared with recent down moves, on a scale from 0 to 100. In SuperCharting you add it from Indicators (search "rsi"). It arrives with TradingView's standard settings: a 14-bar length, 70 and 30 bands, an optional smoothing line and an optional divergence finder. This page covers each setting, how traders read the line, and how to get an alert when RSI crosses a level.
How RSI is calculated
For every bar, the script takes the change in the source (the close by default). It averages the gains and the losses separately with Wilder's smoothing over RSI Length bars, then turns the ratio into a number between 0 and 100:
- RSI = 100 − 100 / (1 + average gain / average loss)
- Above 50, average gains are larger than average losses. Below 50, losses dominate.
- The 70 and 30 bands are the usual overbought and oversold marks. The area beyond each band is shaded with a green or red gradient.
Because the averages are smoothed, RSI reacts to the size of moves, not just their direction. Five small up closes after one large drop can still leave RSI under 50.
How to add and set up RSI in SuperCharting
- Open a chart, for example NSE:NIFTY on the 1h interval.
- Click Indicators, type "rsi" and click Relative strength index. It opens in its own pane under the price.
- Hover the legend line "RSI 14 close" and click the gear to open Settings.
- On Inputs, change RSI Length (14) or Source (Close, or another indicator's plot; see indicators on indicators).
- Under smoothing, Type picks the line drawn over RSI: None, SMA, SMA + Bollinger Bands, EMA, SMMA (RMA), WMA or VWMA. Its Length is 14. BB StdDev (2) only matters with SMA + Bollinger Bands.
- On Style, edit the values of the RSI Upper Band (70), Middle Band (50) and Lower Band (30). Traders who want fewer signals often use 80 and 20.
- Click Ok. The layout saves the settings.
The divergence option
Calculate Divergence is off by default. When you turn it on, the script looks for pivots in RSI five bars either side and compares them with price:
- Regular bullish: price makes a lower low while RSI makes a higher low. It is labelled "Bull" in green.
- Regular bearish: price makes a higher high while RSI makes a lower high. It is labelled "Bear" in red.
A pivot is only confirmed five bars after it happens, so the label is drawn back on the pivot bar once those five bars have closed. It never appears in real time on the bar itself. Keep this delay in mind before trading the labels.
If you also want hidden divergences, add the separate built-in RSI divergence indicator. It has inputs for Pivot Lookback Left and Right (5 each), the lookback range (5 to 60 bars), and switches for Plot Bullish, Plot Hidden Bullish, Plot Bearish and Plot Hidden Bearish.
How traders use RSI
RSI is a context tool, not a signal on its own. Common readings:
- Range markets: moves from below 30 back above 30, or from above 70 back below 70, mark stretched prices returning to normal. On a sideways stock such as NSE:RELIANCE on 1D this often lines up with support and resistance.
- Trending markets: in a strong uptrend RSI can stay between 40 and 80 for weeks. Dips that hold around 40 to 50 are read as strength, and "overbought" is not a reason to sell.
- The 50 line: some traders only take long setups while RSI is above 50 and short setups below it.
- Several timeframes: RSI on 1D sets the bias, RSI on 15m times the entry.
These are ways of reading the indicator for study, not trading advice. To test an RSI rule on past data, add the built-in RSI strategy from the Strategies chip (length 14, oversold 30, overbought 70) and open the Strategy Tester. Past results do not guarantee future results.
Setting an alert on RSI
Choose Add alert on … in the RSI legend's More menu. The Create alert dialog opens with RSI as the condition source. The second box lists the alerts the script itself defines. For the built-in RSI those are the two regular divergence alerts and "Any alert() function call".
Two points matter here:
- An indicator alert runs the script with its default inputs. Settings you changed in the Settings dialog are not carried into the alert. With the built-in RSI that means Calculate Divergence stays off inside the alert, so its divergence alerts will not fire. For divergence alerts, use the RSI divergence indicator, which always calculates them.
- The built-in RSI has no "RSI crosses 70" alert. A price alert compares the symbol's price, not RSI.
For level crosses, save this short script in the Script Editor and add it to the chart. Change the default numbers in the code if you want different levels, because the alert uses them:
//@version=6
indicator("RSI cross alerts", "RSI x", overlay = false)
len = input.int(14, "RSI length", minval = 1)
upper = input.int(70, "Overbought")
lower = input.int(30, "Oversold")
r = ta.rsi(close, len)
plot(r, "RSI", color = color.purple)
hline(upper, "Overbought")
hline(lower, "Oversold")
alertcondition(ta.crossover(r, upper), "RSI crossed above overbought", "RSI crossed above the overbought level")
alertcondition(ta.crossunder(r, lower), "RSI crossed below oversold", "RSI crossed below the oversold level")
Then open Add alert on RSI x…, pick "RSI crossed below oversold" and set Trigger to Once per bar close, so a cross that reverses inside the bar does not fire. Set Expiration (up to Open-ended) and the notifications you want. Price alerts explains each field. To combine RSI with a price condition, see multi-condition alerts.
Frequently asked questions
What is the best RSI length?
There is no best value. 14 is the standard. Shorter lengths such as 7 or 9 give more frequent extremes, and longer ones such as 21 give fewer. Test any change on your own symbol and timeframe.
Why does my divergence label appear late?
A pivot needs five later bars to confirm it, so the label is placed back on the pivot bar once those bars have closed. Divergence alerts fire at confirmation, not at the pivot.
Can I draw a moving average of RSI?
Yes, in two ways. Set the smoothing Type on the Inputs tab, or add an EMA and choose "Relative strength index: RSI" as its Source.
Does RSI work on forex and gold?
Yes. RSI only needs closes, so it works on XAUUSD, EURUSD or BTCUSD as well as NSE stocks, on any interval the chart supports.