//@version=4 study(title="Trend Identifier") len = input(14, title="Length") ob = input(50, title="Upper level") os = input(50, title="Lower level") rsi = rsi(close, len) plot(rsi, color=color.gray) col1 = rsi >= ob ? color.green : na col2 = rsi <= os ? color.red : na plot1 = plot(rsi, style=plot.style_linebr, linewidth=2, color=col1) plot2 = plot(rsi, style=plot.style_linebr, linewidth=2, color=col2) h1 = hline(ob) h2 = hline(os)