Bardyakazemi

Forecast RSI !

Bardyakazemi Updated   
KUCOIN:CBCUSDT   None
"you can use this features To investigate the possibility of divergence or trend line breakout on RSI indicator"

Sometimes there is a trend line in the price chart and RSI indicator that the price and RSI have not reached.
In these cases, you can predict that if the price reaches its trend line, can the RSI reach the desired range or even cross it?
Usually, if these lines are broken, a strong uptrend or downtrend will take place.
In fact, you can check and monitor the possibility of breaking the trend line.
On the other hand, sometimes knowing the range of price pivot and RSI pivot will help you find divergences.
Comment:
//@version=4
study(title="Pre RSI BARDYA", shorttitle="PRE-RSI-BARDYA", format=format.price, precision=2, resolution="")
len = input(14, minval=1, title="Length")
pri=input(10, minval=1, title="EMA")
prisma=input(20, minval=1, title="SMA")
currentclose = input(defval=0.00000, title="current close")
clo2 = input(defval=0.00000, title="next close 2")
clo3 = input(defval=0.00000, title="next close 3")
clo4 = input(defval=0.00000, title="next close 4")
src = input(close, "Source", type = input.source)
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))
alpha = 1/len
upcurrent = alpha*max(currentclose-close, 0)+(1-alpha)*up
downcurrent = alpha*-min(currentclose-close, 0)+(1-alpha)*down
rsicurrent = downcurrent == 0 ? 100 : upcurrent == 0 ? 0 : 100 - (100 / (1 + upcurrent / downcurrent))
alpha2 = 1/len
upnext2 = alpha2*max(clo2-currentclose, 0)+(1-alpha2)*upcurrent
downnext2 = alpha2*-min(clo2-currentclose, 0)+(1-alpha2)*downcurrent
rsinext2 = downnext2 == 0 ? 100 : upnext2 == 0 ? 0 : 100 - (100 / (1 + upnext2 / downnext2))
alpha3 = 1/len
upnext3 = alpha3*max(clo3-clo2, 0)+(1-alpha3)*upnext2
downnext3 = alpha3*-min(clo3-clo2, 0)+(1-alpha3)*downnext2
rsinext3 = downnext3 == 0 ? 100 : upnext3 == 0 ? 0 : 100 - (100 / (1 + upnext3 / downnext3))
alpha4 = 1/len
upnext4 = alpha4*max(clo4-clo3, 0)+(1-alpha4)*upnext3
downnext4 = alpha4*-min(clo4-clo3, 0)+(1-alpha4)*downnext3
rsinext4 = downnext4 == 0 ? 100 : upnext4 == 0 ? 0 : 100 - (100 / (1 + upnext4 / downnext4))
//plot(up, "up", color=color.black)
//plot(down, "down", color=color.yellow)
//plot(change(src), "change", color=color.green)
plotshape(rsicurrent, "RSI current", color=color.red,show_last =1, offset =0, style=shape.xcross, location= location.absolute, size = size.tiny, text= "current")
plotshape(rsinext2, "RSI next 2", color=color.red,show_last =1, offset =1, style=shape.xcross, location= location.absolute, size = size.tiny ,text= "2")
plotshape(rsinext3, "RSI next 3", color=color.red,show_last =1, offset =2, style=shape.xcross, location= location.absolute, size = size.tiny ,text= "3")
plotshape(rsinext4, "RSI next 4", color=color.red,show_last =1, offset =3, style=shape.xcross, location= location.absolute, size = size.tiny ,text= "4")
plot(rsi, "RSI", color=#8E1599)
plot(ema(rsi,pri), "ema", color=#13eb1d )
plot(sma(rsi,prisma), "sma", color=#13b3eb)
band1 = hline(70, "Upper Band", color=#C0C0C0)
band0 = hline(30, "Lower Band", color=#C0C0C0)
fill(band1, band0, color=#9915FF, transp=90, title="Background")
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.