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

Re: [amibroker] zig,trough,peak questions



PureBytes Links

Trading Reference Links

Fred wrote:

> In the attached message Tomasz said he previously posted a JScript
> version
> of "Zig" on this board. I searched for it at Yahoo Groups, but did
> not
> find it.
>
> If someone has it can you re-post it or email it directly to me.
>
> Thanks,
>
> Fred
> QED@xxxx
>
>
> >Mike,
> >
> >1. Yes.
> >2. % means the change of ARRAY. it can be any array not necessarily
> close.
> > The algorithm is that the reversal happens if price movement
> exceeds
> > % change.
> > The main problem is that algorithm needs to know FUTURE price
> movement to
> > make the decision if it should reverse or not. That's why you
> should
> > NOT build
> > trading systems on Zig, Trough,Peak
> > I posted some time ago a JScript implementation of zig on this
> board.
> >3. Trough/Peak functions are Zig-based. Trough Peaks are points where
> Zig
> >reverses.
> >
> >Best regards,
> >Tomasz Janeczko
> >amibroker.com
> >----- Original Message -----
> >From: "Mike Pham" <mmqp@xxxx>
> >To: "amiBroker" <amibroker@xxxxxxxxxxxxxxx>
> >Sent: Tuesday, April 23, 2002 12:05 AM
> >Subject: [amibroker] zig,trough,peak questions
> >
> >
> > > Hi Tomasz and all,
> > >
> > > I need some help understanding the parameters in above
> > > functions. (zig,trough,peak)
> > >
> > > 1. Are the "change" parameters the same for all three
> > > functions?
> > >
> > > 2. In Zig, % change means the close price of the
> > > current period (today) must be larger/smaller? than
> > > yesterday to give you a true?
> > >
> > > 3. In trough/peak; What does change means? percentage
> > > change?
> > >
> > > I try to experiment things, but it's still not very
> > > clear to me. Thanks for your patience and time.
> > >
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT


>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

Subject: Re: [amibroker] Tomasz Janeczko _ ZIGZAG
Date: Mon, 11 Feb 2002 10:42:08 +0100
From: "Tomasz Janeczko" <amibroker@xxxx>
Reply-To: amibroker@xxxxxxxxxxxxxxx
To: <amibroker@xxxxxxxxxxxxxxx>

Hello,

Here comes the one that uses H/L but it has one drawback
( if there is a different number of peaks from highs than the number of
troughs from lows it skips extra swings):

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;

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "nenapacwanfr" <nenapacwanfr@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, February 11, 2002 10:14 AM
Subject: [amibroker] Tomasz Janeczko _ ZIGZAG

> Dear Tomasz
>
> can I have the Jscript source of zigzag function?
> or the workspace?
>
>
> stephane carrasset
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

Yahoo! Groups Sponsor
ADVERTISEMENT



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.