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

[EquisMetaStock Group] ZigZag-based indicator toolkit



PureBytes Links

Trading Reference Links

Below is a complete ZigZag-based indicator toolkit.

Unlike the standard MetaStock version, it allows the use of points ($) 
in Peak/Trough functions.  It has multiple output choices for ZigZag, 
Peak/Trough values (support & resistance), and Peak/Trough signals.

As usual, beware of the hindsight used to determine the last (dynamic) 
leg of the ZigZag & Peak/Trough.


MetaStock -> Tools -> Indicator Builder -> New ->
Copy and paste complete formulae between "---8<---" lines.

================
ZigZag-based set
================
---8<--------------------------

{ Complete ZigZag-based indicator set v1.0 }
{ Allows use of points in Peak/Trough functions}

{ ©Copyright 2005 Jose Silva
  The grant of this license is for personal use
  only - no resale or repackaging allowed.
  All code remains the property of Jose Silva.
  http://www.metastocktools.com }

{ User inputs }
ch:=Input("Minimum reversal amount",
 .001,100000,.5);
method:=Input("Method:  [1]$ points,  [2]% percent",1,2,1);
x:=Input("[1]Open [2]High [3]Low [4]Close [5]WClose [6]Pvar",1,6,4);
Nth:=Input("Nth Peak/Trough",1,100,1);
plot:=Input("Peaks/Troughs: [1]Values, [2]Signals, [3]ZigZag",1,3,1);

{ Select price field }
pr:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,P,C)))));

{ Zig Zag }
zzPts:=Zig(pr,ch,$);
zzPer:=Zig(pr,ch,%);
zz:=If(method=1,zzPts,zzPer);

{ Peak/Trough values }
pkPts:=Peak(Nth,zzPts,.001);
pkVal:=If(method=1,pkPts,Peak(Nth,pr,ch));
trPts:=Trough(Nth,zzPts,.001);
trVal:=If(method=1,trPts,Trough(Nth,pr,ch));

{ Peak/Trough signals }
pkPts:=PeakBars(Nth,zzPts,.001)=0;
pk:=If(method=1,pkPts,PeakBars(Nth,pr,ch)=0);
trPts:=TroughBars(Nth,zzPts,.001)=0;
tr:=If(method=1,trPts,TroughBars(Nth,pr,ch)=0);

{ Plot ZigZag/Peaks/Troughs on chart,
   Peak & Trough signals in own window }
If(plot=1,pkVal,If(plot=2,pk,zz));
If(plot=1,trVal,If(plot=2,-tr,zz))

---8<--------------------------


jose '-)
http://www.metastocktools.com







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