This Rsi i use period 200 so I can draw trendlines and identify changes earlier.
study(title="RSI-Trend", shorttitle="RSI-Trend") src = close, len = input(200, minval=1, title="Length") smooth = input(1, minval=0, title="Smooth") up = rma(max(change(src), 0), len) down = rma(-min(change(src), 0), len) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) rsiema=ema(rsi, smooth) plot(rsiema, color=blue, transp=0, linewidth=2) band1 = hline(49.5) band0 = hline(50.5) banmx = hline(55) banmn = hline(45) ban50 = hline(50) fill(band1, band0, color=red, transp=80)