SuperCharting
Sign in Get started Account Open charts

Learn / Indicators

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:

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

  1. Open a chart, for example NSE:NIFTY on the 1h interval.
  2. Click Indicators, type "rsi" and click Relative strength index. It opens in its own pane under the price.
  3. Hover the legend line "RSI 14 close" and click the gear to open Settings.
  4. On Inputs, change RSI Length (14) or Source (Close, or another indicator's plot; see indicators on indicators).
  5. 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.
  6. 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.
  7. 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:

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:

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:

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.

Try it on a live chart

SuperCharting runs in your browser: charts, Pine-compatible scripts, the Strategy Tester, alerts and the screener, with Indian and global markets.

Create a free account More guides