[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

zig zag formula



PureBytes Links

Trading Reference Links


This is a repost of the formula from Spyros, taken 
from archives.
 
Formula Name: SR ZigZag Trend{SR ZigZag 
Trend}{by Spyros Raftopoulos}{E-mail :  
raftsp@xxxxxxxxx}{This binary indicator is based on the Metastock's Zig 
Zag function.1 = confirmed uptrend,   -1 = confirmed 
downtrend}perc:=Input("percent",1,100,10);tr:=ValueWhen(1,Zig(C,perc,%)>Ref(Zig(C,perc,%),-1) 
ANDRef(Zig(C,perc,%),-1)<Ref(Zig(C,perc,%),-2),Ref(Zig(C,perc,%),-1));tr:=If( 
(C-tr)*100/tr>= perc ,tr,0);tr:=If( tr=0, ValueWhen(1,tr<>0,tr), 
tr);pk:=ValueWhen(1,Zig(C,perc,%)<Ref(Zig(C,perc,%),-1) 
ANDRef(Zig(C,perc,%),-1)>Ref(Zig(C,perc,%),-2),Ref(Zig(C,perc,%),-1));pk:=If((C-pk)*100/pk 
<=-perc , pk, 0);pk:=If( pk=0, ValueWhen(1,pk<>0,pk), 
pk);res:=If(pk<>Ref(pk,-1), -1,If(tr<>Ref(tr,-1), 1, 
0));res:=If(res=0,ValueWhen(1,res<>0,res),res);res