PureBytes Links
Trading Reference Links
|
Hello,
It does work but you have to adjust "reversal" variable to fit security you are trading.
Current value of 0.2 represents 20% threshold level and may be too high for certain securities.
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "tintin92" <tintin922002@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, December 23, 2004 11:33 AM
Subject: Re: [amibroker] Looking for Zig Zag code, prefer AFL code.
>
>
> I tested it.
> Dont work.
> Look like a Plot(Low)
>
> Tintin92
>
>
> ----- Original Message -----
> From: Anthony Faragasso
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Thursday, December 23, 2004 4:14 AM
> Subject: Re: [amibroker] Looking for Zig Zag code, prefer AFL code.
>
>
> EnableScript("jscript");
>
> <%
> Reversal = 0.2; // <---- YOU SHOULD CHANGE THIS !!!!!
> function FillLine( startbar, startval, endbar, endval )
> {
> for( j = startbar; j <= endbar; j++ )
> {
> ZigArray[ j ] = startval + ( j - startbar) * (endval-startval)/( endbar -
> startbar );
> }
> }
>
> High = VBArray( AFL("High") ).toArray();
> Low = VBArray( AFL("Low" ) ).toArray();
> ZigArray = Low;
> Maximum = High[ 0 ];
> Minimum = Low[ 0 ];
> MinBar = 0;
> MaxBar = 0;
> startbar = 0;
> if( High[ 1 ] > High[ 0 ] )
> {
> dir = 1;
> Extremum = Low[ 0 ];
> }
> else
> {
> dir = -1;
> Extremum = High[ 0 ];
> }
> ExBar = 0;
> for( i = 1; i < High.length; i++ )
> {
> if( High[ i ] > Maximum )
> {
> Maximum = High[ i ];
> MaxBar = i;
> }
> if( Low[ i ] < Minimum )
> {
> Minimum = Low[ i ];
> MinBar = i;
> }
> if( dir == 1 && ( Minimum < (1- Reversal ) * Maximum ) )
> {
> FillLine( ExBar, Extremum, MaxBar, Maximum );
> Extremum = Maximum;
> ExBar = MaxBar;
> Maximum = Minimum;
> MaxBar = MinBar;
> dir = -1;
> }
> if( dir == -1 && ( Maximum > (1+ Reversal ) * Minimum ) )
> {
> FillLine( ExBar, Extremum, MinBar, Minimum );
> Extremum = Minimum;
> ExBar = MinBar;
> Minimum = Maximum;
> MinBar = MaxBar;
> dir = 1;
> }
>
> }
> AFL("graph0") = ZigArray;
> %>
> Graph1 = Close;
> Graph1Style = 64;
> ----- Original Message -----
> From: tintin92
> To: amibroker@xxxxxxxxxxxxxxx
> Sent: Wednesday, December 22, 2004 6:58 AM
> Subject: Re: [amibroker] Looking for Zig Zag code, prefer AFL code.
>
>
> Hi Graham,
>
>
>>
>> Don't get me wrong, but the help screens are always a good place to start
>> SYNTAX zig(ARRAY, change )
>> RETURNS ARRAY
>> FUNCTION Calculates the minimum % change Zig Zag indicator. Caveat: this
>> function is based on Zig-Zag indicator and may look into the future - this
>> means that you can get unrealistic results when back testing trading
> system
>> using this indicator. This function is provided rather for pattern and
> trend
>> recognition formulas.
>> EXAMPLE zig(close,5)
>>
>
>
> OK, I find what you talk about in the AB help file.
>
> But, what I am looking for is full AFL code, not the ready to use indicator.
> In other words, I am looking for the full AFL code of the zig indicator.
>
> Cheers.
>
> Tintin92
>
>
>> Cheers,
>> Graham
>> http://e-wire.net.au/~eb_kavan/
>>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.0 - Release Date: 12/17/2004
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> Yahoo! Groups Sponsor
>
> Get unlimited calls to
> U.S./Canada
>
>
>
>
> 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 the Yahoo! Terms of Service.
>
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.296 / Virus Database: 265.6.0 - Release Date: 12/17/2004
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/
|