In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
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 os = cross(r, oversold) and falling(r, 1) ? close : os plot(ob, color=maroon, style=linebr, linewidth=2) plot(os, color=green, style=linebr, linewidth=2)