RSI Chandeliers.
Voici à la demande de Mallory, le RSI en représentation chandeliers. L'indicateur est calculé sur la cloture des barres précédentes et sur les données intra-barre de la dernière bougie. Une vue de l'indicateur (14) appliqué à GOOG en daily :
Il faut bien sûr créer 3 indicateurs : bas, haut et corps. Mettre également p en variable : longueur du RSI.
Et les codes pour Proréaltime :
//////////// rsi chandelier bas ////////////////
hausse=max(0,close-close[1])
baisse=max(0,close[1]-close)
mh=wilderaverage[p](hausse)
mb=wilderaverage[p](baisse)
rs=mh/mb
rsii=100-100/(1+rs)
hauss=max(0,open-close[1])
baiss=max(0,close[1]-open)
testh=(mh[1]*(p-1)+hauss)/p
testb=(mb[1]*(p-1)+baiss)/p
testrs=testh/testb
testrsi=100-100/(1+testrs)
hauss1=max(0,low-close[1])
baiss1=max(0,close[1]-low)
testh1=(mh[1]*(p-1)+hauss1)/p
testb1=(mb[1]*(p-1)+baiss1)/p
testrs1=testh1/testb1
testrsi1=100-100/(1+testrs1)
c2=min(rsii,testrsi)
r=abs(c2-testrsi1)
r=(r)/29
b1=testrsi1
c=1
b2=b1+r
b3=b2+r
b4=b3+r
b5=b4+r
b6=b5+r
b7=b6+r
b8=b7+r
b9=b8+r
b10=b9+r
b11=b10+r
b12=b11+r
b13=b12+r
b14=b13+r
b15=b14+r
b16=b15+r
b17=b16+r
b18=b17+r
b19=b18+r
b20=b19+r
b21=b20+r
b22=b21+r
b23=b22+r
b24=b23+r
b25=b24+r
b26=b25+r
b27=b26+r
b28=b27+r
b29=b28+r
b30=b29+r
return b1 coloured by c,b2 coloured by c,b3 coloured by c,b4 coloured by c,b5 coloured by c,b6 coloured by c,b7 coloured by c,b8 coloured by c,b9 coloured by c,b10 coloured by c,b11 coloured by c,b12 coloured by c,b13 coloured by c,b14 coloured by c,b15 coloured by c,b16 coloured by c,b17 coloured by c,b18 coloured by c,b19 coloured by c,b20 coloured by c,b21 coloured by c,b22 coloured by c,b23 coloured by c,b24 coloured by c,b25 coloured by c,b26 coloured by c,b27 coloured by c,b28 coloured by c,b29 coloured by c,b30 coloured by c
///////////// rsi chandelier haut ///////////////
hausse=max(0,close-close[1])
baisse=max(0,close[1]-close)
mh=wilderaverage[p](hausse)
mb=wilderaverage[p](baisse)
rs=mh/mb
rsii=100-100/(1+rs)
hauss=max(0,open-close[1])
baiss=max(0,close[1]-open)
testh=(mh[1]*(p-1)+hauss)/p
testb=(mb[1]*(p-1)+baiss)/p
testrs=testh/testb
testrsi=100-100/(1+testrs)
hauss1=max(0,high-close[1])
baiss1=max(0,close[1]-high)
testh1=(mh[1]*(p-1)+hauss1)/p
testb1=(mb[1]*(p-1)+baiss1)/p
testrs1=testh1/testb1
testrsi1=100-100/(1+testrs1)
c2=max(rsii,testrsi)
r=abs(c2-testrsi1)
r=(r)/29
b1=c2
c=1
b2=b1+r
b3=b2+r
b4=b3+r
b5=b4+r
b6=b5+r
b7=b6+r
b8=b7+r
b9=b8+r
b10=b9+r
b11=b10+r
b12=b11+r
b13=b12+r
b14=b13+r
b15=b14+r
b16=b15+r
b17=b16+r
b18=b17+r
b19=b18+r
b20=b19+r
b21=b20+r
b22=b21+r
b23=b22+r
b24=b23+r
b25=b24+r
b26=b25+r
b27=b26+r
b28=b27+r
b29=b28+r
b30=b29+r
return b1 coloured by c,b2 coloured by c,b3 coloured by c,b4 coloured by c,b5 coloured by c,b6 coloured by c,b7 coloured by c,b8 coloured by c,b9 coloured by c,b10 coloured by c,b11 coloured by c,b12 coloured by c,b13 coloured by c,b14 coloured by c,b15 coloured by c,b16 coloured by c,b17 coloured by c,b18 coloured by c,b19 coloured by c,b20 coloured by c,b21 coloured by c,b22 coloured by c,b23 coloured by c,b24 coloured by c,b25 coloured by c,b26 coloured by c,b27 coloured by c,b28 coloured by c,b29 coloured by c,b30 coloured by c
////////////// rsi chandelier corps ///////////////
hausse=max(0,close-close[1])
baisse=max(0,close[1]-close)
mh=wilderaverage[p](hausse)
mb=wilderaverage[p](baisse)
rs=mh/mb
rsii=100-100/(1+rs)
hauss=max(0,open-close[1])
baiss=max(0,close[1]-open)
testh=(mh[1]*(p-1)+hauss)/p
testb=(mb[1]*(p-1)+baiss)/p
testrs=testh/testb
testrsi=100-100/(1+testrs)
r=abs(testrsi-rsii)
r=(r)/29
if testrsi<rsii then
b1=testrsi
else
b1=rsii
endif
b2=b1+r
b3=b2+r
b4=b3+r
b5=b4+r
b6=b5+r
b7=b6+r
b8=b7+r
b9=b8+r
b10=b9+r
b11=b10+r
b12=b11+r
b13=b12+r
b14=b13+r
b15=b14+r
b16=b15+r
b17=b16+r
b18=b17+r
b19=b18+r
b20=b19+r
b21=b20+r
b22=b21+r
b23=b22+r
b24=b23+r
b25=b24+r
b26=b25+r
b27=b26+r
b28=b27+r
b29=b28+r
b30=b29+r
c=rsii-testrsi
return b1 coloured by c,b2 coloured by c,b3 coloured by c,b4 coloured by c,b5 coloured by c,b6 coloured by c,b7 coloured by c,b8 coloured by c,b9 coloured by c,b10 coloured by c,b11 coloured by c,b12 coloured by c,b13 coloured by c,b14 coloured by c,b15 coloured by c,b16 coloured by c,b17 coloured by c,b18 coloured by c,b19 coloured by c,b20 coloured by c,b21 coloured by c,b22 coloured by c,b23 coloured by c,b24 coloured by c,b25 coloured by c,b26 coloured by c,b27 coloured by c,b28 coloured by c,b29 coloured by c,b30 coloured by c