//////////////////ATR_RSI
rc=rsi[p](close)
rh=rsi[p](high)
rl=rsi[p](low)
c1 =abs( rh - rl)
c2 = abs( rc[1]-rh )
c3 = abs ( rc[1] - rl )
c4 = max(c1,c2)
c5 = max(c4,c3)
atr =average[bb](c5)
//////////////////////////////////////////////
/////SUPER TREND RSI
avg=rc
up=avg+aa*atr
dn=avg-aa*atr
/////////////////////////////////////////////////////////
once trend=1
if rc>up[1] then
trend=1
elsif rc
trend=-1
endif
if trend<0 and trend[1]>0 then
flag=1
else
flag=0
endif
if trend>0 and trend[1]<0 then
flagh=1
else
flagh=0
endif
if trend>0 and dn
dn=dn[1]
endif
if trend<0 and up>up[1] then
up=up[1]
endif
if flag=1 then
up=avg+aa*atr
endif
if flagh=1 then
dn=avg-aa*atr
endif
if trend=1 then
super=dn
else
super=up
endif
return super coloured by trend as "supertrend_rsi",rc as "rsi" ,70 as "70",50 as "50",30 as "30"
////////////////////////////////////fin du code --- END
Nessun commento:
Posta un commento