21/02/11

SUPER TREND RSI

p=  période rsi défaut = 9
//////////////////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 

02/02/11

indicatori,

////////////////volumi.pos.e.neg.
volpos=0
volneg=0
for n=m downto 1
  
    if close[n-1]=>open[n-1] then
        volpos=volpos+volume[n-1]
    elsif close[n-1]
        volneg=volneg-volume[n-1]
    endif
next
return volpos coloured(0,255,0) as "VOLUMI POSITIVI", volneg coloured(255,0,0) AS "VOLUMI NEGATIVI",0 as"zero",tema[m](volpos+volneg)as " trigger"

////////////////sintonia volume prezzo
a=close/average[20](volume)
return close*a
www.finanza.com
info.gif (242 byte)