PureBytes Links
Trading Reference Links
|
Thanks for the script although had already tried this one and
concluded that it doesn't quite duplicate the one found in eSignal.
Doesn't look quite right to me, seems to zig when it should zag. :-)
Aequalsz
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> EnableScript("jscript");
>
>
>
> <%
>
> Reversal = 0.2;
>
> 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;
------------------------ 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/
|