Mercuzio
ex Drenaggio
........
//Fisher Transform by John Ehlers un po' modificata
//len=10 aggiungere la variabile len
if a=0 then
p=close
endif
if a=1 then
p=Typicalprice
endif
if a=2 then
p=high
endif
if a=3 then
p= low
endif
if a>3 then
p=close
endif
maxh=highest[len](p)
minl=lowest[len](p)
if barindex<len then
val1=2*((p-minl)/(maxh-minl)-0.5)
else
val1=0.33*2*((p-minl)/(maxh-minl)-0.5)+0.67*val1[1]
endif
if val1>.99 then
val2=.999
elsif val1<-0.99 then
val2=-0.999
else
val2=val1
endif
if barindex<len then
fish=log((1+val2)/(1-val2))
else
fish=0.5*log((1+val2)/(1-val2))+0.5*fish[1]
endif
return fish as "So What ?" , 0 as "0", x as "top",y as "down"
......
...meglio così....
eliminata la prima parte di codice...
maxh=highest[len](customclose)
minl=lowest[len](customclose)
if barindex<len then
val1=2*((customclose-minl)/(maxh-minl)-0.5)
else
val1=0.33*2*((customclose-minl)/(maxh-minl)-0.5)+0.67*val1[1]
endif
if val1>.99 then
val2=.999
elsif val1<-0.99 then
val2=-0.999
else
val2=val1
endif
if barindex<len then
fish=log((1+val2)/(1-val2))
else
fish=0.5*log((1+val2)/(1-val2))+0.5*fish[1]
endif
return fish as "So What ?" , 0 as "0", x as "top",y as "down"
//////////////////////
saluti