// HARSI by JS le 02.10.2023 modifié 02.10.2023
defparam calculateonlastbars = 150
//variables:
rsip=7
smoothing=1
halength=14
rsihelp= RSI[rsip]((high+close+low+open)/4)//-50
rsihelp2= RSI[halength]((high+close+low+open)/4)//-50
closersi2= rsi[halength](close)//-50
if barindex>0 then
openrsi2=rsi[halength](close[1])//-50
else
openrsi2=rsi[halength](close)//-50
endif
rsihighraw2= rsi[halength](high)//-50
rslowraw2= rsi[halength](low)//-50
rsihigh2= max(rsihighraw2,rslowraw2)
rsilow2=min(rsihighraw2,rslowraw2)
haclose= (closersi2+openrsi2+rsihigh2+rsilow2)/4
if barindex > halength+2 then
haopen = ((haopen[1]*smoothing) +haclose[1])/(smoothing+1)
else
haopen = (closersi2 +openrsi2)/2
endif
hahigh= max(rsihigh2, max(haopen,haclose))
halow = min(rsilow2 , min( haopen, haclose))
if haclose > haopen then
r=0
g=153
b=153
else
r=238
g=73
b=73
endif
DRAWCANDLE(haopen, hahigh, halow, haclose) COLOURED(r,g,b) BORDERCOLOR(R,G,B)
if barindex > rsip then
rsismoothed = (rsismoothed[1]+ rsihelp)/2
else
rsismoothed = rsihelp
endif
return rsismoothed as “RSI-Smoothed”, 20 as “20”, 30 as “30”, 70 as “70”, 80 as “80”