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][JR]RSI Donchian Channels", shorttitle="[RS][JR]RSI DC", overlay=false) src = input(defval=close, type=source, title="RSI Source:") rsi_length = input(defval=14, minval=1, title="RSI Period Length:") donchian_length = input(20, minval=1, title="Donchian Lookback Period Length:") rsi1 = rsi(src, rsi_length) lower = lowest(rsi1, donchian_length) upper = highest(rsi1, donchian_length) basis = avg(upper, lower) plot(rsi1, color=aqua) l = plot(lower, color=blue) u = plot(upper, color=blue) plot(basis, color=orange) fill(u, l, color=blue) hline(0) hline(50) hline(100)