PureBytes Links
Trading Reference Links
|
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/
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
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
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|