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

[EquisMetaStock Group] Zig Zag indicator



PureBytes Links

Trading Reference Links

 
 Hi,
	
	I am reproducing below a code which was written by Spyros 
Raftopoulos:

{******** Start of code **********}

{SR ZigZag Trend (SR ZZT) v.4}
{by Spyros Raftopoulos}

{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,10);
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,1,
If(vr<=PD AND zz0<zz1,-1,0));
res:=If(res<>0,res,ValueWhen(1,res<>0,res));
res

{******** End of code **********}

This code is to be used as an indicator.

Would it be possible to use this code in an exploration to find a 
confirmed up trend? (That is, yesterday it was a confirmed down 
trend but today it is a confirmed up trend)

Variables to be used are (1) Closing price (2) Reversal amount =6 
(3) Method = Percent

Any help would be greatly appreciated.

Thanks in advance.


George




 
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/