Jayadev Rana Get a custom script
Free indicator · Pine Script v6

RSI Zones

A clean RSI in its own pane with 70/30 levels and a background that turns red when overbought and teal when oversold.

IndicatorPine Script v6Separate paneFree

Get the codeDownload .pine.txt

Snapshots

RSI Zones below an S&P 500 4h chart: shaded when RSI is above 70 or below 30.
RSI Zones below an S&P 500 4h chart: shaded when RSI is above 70 or below 30.

How it works

  1. overlay = false puts the RSI in its own pane under the price chart.
  2. The background shading uses a nested ternary: red above 70, teal below 30, no colour (na) otherwise.
  3. Change the RSI length in the indicator settings; 14 is the classic default.

Settings

SettingDefaultWhat it does
RSI Length14Look-back of the RSI calculation

Source code

In TradingView: open the Pine Editor, create a new indicator, paste the code, then click "Add to chart".

rsi-zones.pine.txtGitHubDownload
//@version=6
indicator("RSI Zones", overlay = false)

len = input.int(14, "RSI Length", minval = 2)
r   = ta.rsi(close, len)

plot(r, "RSI", color.purple, 2)
hline(70, "Overbought", color.red)
hline(30, "Oversold", color.teal)
bgcolor(r > 70 ? color.new(color.red, 85) : r < 30 ? color.new(color.teal, 85) : na)

Watch it built

This script is written line by line in the TradingView Masterclass video.

Need a custom indicator or strategy?

Non-repainting Pine Script v6, backtested with real costs, alert and webhook ready. Fixed quote within 24 hours.

Free and open source under the Mozilla Public License 2.0. Educational content only, not financial advice. Backtest results are historical and include the costs stated; past performance does not predict future results. © Jayadev Rana · Privacy · Terms