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

RE: [amibroker] RE: Subject: Anyone know where I can get the code for Zig??



PureBytes Links

Trading Reference Links

Is your zigzag code the same as whats in the library?
 
 

Paul Ho



From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Graham
Sent: Monday, 13 June 2005 9:02 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] RE: Subject: Anyone know where I can get the code for Zig??

This is not a true plot of what you normally see with ZigZag as I did
not attempt to make it into the normal straight lines between peaks
and troughs. I just modified an existing code that I have to reflect
simplified zigzag.

// ZigZag
// Graham Kavanagh  13 Jun 2005

ZZReverse = Param("ZigZag %",10,1,30,1)/100;

SetBarsRequired(10000,10000);
UseBar = IIf( IsIndex(), H!=L, V>0 );//for padded data, ie non traded
days included

ZZC[0] = C[0];
ZZMoveup[0] = 0;

for( i = 1; i < BarCount; i++ )
{
if( C[i] > ZZC[i-1] AND ZZMoveup[i-1] AND UseBar[i] ) // UU
{
  ZZC[i] = C[i];
  ZZMoveup[i] = 1;
}
else
{  
  if( C[i]<=(ZZC[i-1]*(1-ZZReverse)) AND ZZMoveup[i-1] AND UseBar[i] ) // UD
  {
   ZZC[i] = C[i];
   ZZMoveup[i] = 0;
  }
  else
  {
   if( C[i] < ZZC[i-1] AND ZZMoveup[i-1]==0 AND UseBar[i] ) // DD
   {
    ZZC[i] = C[i];
    ZZMoveup[i] = 0;
   }
   else
   {
    if( C[i]>=(ZZC[i-1]*(1+ZZReverse)) AND ZZMoveup[i-1]==0 AND
UseBar[i] ) // DU
    {
     ZZC[i] = C[i];
     ZZMoveup[i] = 1;
    }
    else
    {
     ZZMoveup[i] = ZZMoveup[i-1];
     ZZc[i] = ZZc[i-1];
    }
   }
  }
}
}

Plot(C,"Close",colorWhite,styleLine);
Plot(zzc,"ZZ",IIf(zzmoveup,colorGreen,colorRed),styleLine|styleNoRescale);


On 6/13/05, forex_bots <forex_bots@xxxxxxxxxxx> wrote:
> [+++ ] ZigZag??
> [+++ ]
>
> http://www.wealth-lab.com/cgi-bin/WealthLab.DLL/editsystem?id=38876
>
> ChartScript - Zigzag Trend Indicator S&C Nov2003
>
> I'm not sure this is what you were looking for. If it is you maybe able to adapt
> the code.
>
> There is also a script called Zig-Zag Targets. Search for that as well.
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


--
Cheers
Graham
http://e-wire.net.au/~eb_kavan/


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Yahoo! Groups Links