Docs

ITMScript

Show RSI with levels and a zone tint

Draw the RSI with an upper and a lower level and tint the background while it sits in either zone.

Draw the RSI with two levels and tint the background while it is beyond either one.

itm
//@itmscript 2
study("RSI zones", overlay=false)
len = input.int(14, "Length", min=2, max=100)
upper = input.float(70, "Upper level", min=50, max=95)
lower = input.float(30, "Lower level", min=5, max=50)
r = ta.rsi(close, len)
plot(r, "RSI", color=color.purple, width=2, style=line)
hline(upper, "Upper", color=color.gray, style=dashed)
hline(lower, "Lower", color=color.gray, style=dashed)
bgcolor(r > upper ? color.new(color.red, 88) : r < lower ? color.new(color.green, 88) : na)

What you see

The RSI is a purple line in its own pane. Two dashed lines mark the levels. The background turns red while the RSI is above the upper level and green while it is below the lower level. The line starts once it has enough bars to exist.

Change these inputs

  • Length. The window of the RSI, from 2 to 100 bars. A shorter window swings more widely.
  • Upper level. From 50 to 95. Moving it moves the upper line and the red tint together.
  • Lower level. From 5 to 50. Moving it moves the lower line and the green tint together.