PROTECTED SOURCE SCRIPT
Updated

RSI With Trend Color

13 735
RSI > 50 = Bullish (rsi color green)
RSI < 50 = Bearish (rsi color red)
Release Notes
add yellow color to show overbought and oversold condition
Release Notes
//version=3
study(title="Relative Strength Index", shorttitle="RSI")
src = close, len = input(14, minval=1, title="Length")
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))
plotcolor1 = iff(rsi[1] > 50, lime, red)
plotcolor2 = iff((rsi[1] > 70 or rsi < 30), yellow, plotcolor1)
plot(rsi, linewidth=1, color=plotcolor1, transp=0)
plot(rsi, linewidth=1, color=plotcolor2, transp=0)
band1 = hline(70)
band0 = hline(50)
band2 = hline(30)
fill(band1, band0, color=green, transp=90)
fill(band0, band2, color=red, transp=90)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.