RSI

Pine Script indicator by Chart GT · Published

Relative Strength Index with overbought and oversold levels.

Tags: momentum, oscillator, overbought

Source code

//@version=6
// @name RSI
// @description Relative Strength Index with overbought and oversold levels.
// @tags momentum,oscillator,overbought
indicator("RSI", overlay=false, precision=2)
length = input.int(14, "Length", minval=1)
src = input.source(close, "Source")
upper = input.float(70, "Overbought")
lower = input.float(30, "Oversold")
r = ta.rsi(src, length)
plot(r, "RSI", color=color.purple, linewidth=2)
hline(upper, "Overbought", color=color.red)
hline(lower, "Oversold", color=color.green)
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")

License: MPL-2.0

Open the chart to add it, or browse more community scripts.