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

[EquisMetaStock Group] question about an adaptation of the ZigZag indicator made by Spyros Raftopoulos



PureBytes Links

Trading Reference Links

Congrats guys for the great Q&A you make here...

I have a question for you... I like to use the adaptation of the ZigZag 
indicator made by Spyros Raftopoulos (the formula is at the end).

I was wondering if there ia way for me to use a variable in the amnt 
(reversal amount). I would like to use something related to a volatility 
measure, that would increase my stops in a more volatile market and reduce 
them in a less one.

Thanks for all the help
Andre


{by Spyros Raftopoulos - nov 2003 SC}

{It is based on the Zig Zag indicator and it returns 1 for a confirmed
uptrend, and -1 for a confirmed downtrend.}

{****************************************}
vr:=Input("Field (0=Ind/tor, 1=Open, 2=High, 3=Low, 4=Close)",0,4,0);
amnt:=Input("Reversal amount",0.001,1000,3);
md:=Input("Method (1=Percent, 2=Points)",1,2,1);

{****************************************}

vr:=If(vr=1,OPEN,If(vr=2,HIGH,If(vr=3,LOW,If(vr=4,CLOSE,P))));
zz0:=If(md=1, Zig(vr,amnt,%), Zig(vr,amnt,$));
zz1:=Ref(zz0,-1);
zz2:=Ref(zz0,-2);

{****************************************}

tr:=ValueWhen(1,zz0>zz1 AND zz1<zz2, zz1);
pk:=ValueWhen(1,zz0<zz1 AND zz1>zz2, zz1);
PU:=If(md=1,tr+Abs(tr)*amnt/100,tr+amnt);
PD:=If(md=1,pk-Abs(pk)*amnt/100,pk-amnt);

res:=If(vr>=PU AND zz0>zz1,2,
If(vr<=PD AND zz0<zz1,-1,0));
res:=If(res<>0,res,ValueWhen(1,res<>0,res));
res






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/