study(title="[RS]RSI Overbought/Oversold Levels V0", shorttitle="[RS]RSIOOL.V0", overlay=true) overbought = input(70) oversold = input(30) length = input(8) smooth = input(4) r = sma(rsi(close, length), smooth) ob = cross(r, overbought) and rising(r, 1) ? close : ob[1] os = cross(r, oversold) and falling(r, 1) ? close : os[1] plot(ob, color=maroon, style=linebr, linewidth=2) plot(os, color=green, style=linebr, linewidth=2)