Metastock Indicator Formula |
Zig Zag Validity |
Formula: |
perc:=Input("Percent",2,100,10);
Z:=Zig(C,perc,%);
last:=ValueWhen(1,
( Z > Ref(Z,-1) AND Ref(Z,-1) < Ref(Z,-2) )
OR
( Z < Ref(Z,-1) AND Ref(Z,-1) > Ref(Z,-2) ),
Ref(Z,-1));
pc:=(C-last) * 100 / last;
pc:= Abs(pc);
SD:=(z>Ref(z,-1) AND Ref(z,-1)>Ref(z,-2)) OR (z
Ref(z,-1)
res:=If(pc>=perc ,1,0);
If(Alert(res,2) AND SD,1,res); |
|
|