i need some help i am try to code an rsi with an histrogram derive from two 2 moving average (the signal for the movinga average is the rsi it self) , but when i write this indicator in pine script the istogram start from the 0 level and not the 50 livel like the rsi can you plese give my some tips on how to fix this problem.
can you plese code a version of this indicator for marcket scope .
thank you.
- Code: Select all
//@version=3
study(title="Relative Strength Index LEO", 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))
rsimoving9 = sma(rsi,9)
rsimoving45 = sma(rsi,45)
rsihistp = (rsimoving45 - rsimoving9 )
plot(rsi, color=lime)
plot(rsimoving9, color=blue)
plot(rsimoving45, color=yellow)
plot(rsihist,style=histogram , color=red)
band2 = hline(50)
band1 = hline(60)
band0 = hline(40)