PureBytes Links
Trading Reference Links
|
hello,
perhaps the code in afl with loops could help you, you can arrange it
to suit your wishes
HP = HHVBars( High, 10 ) == 0;
LP = LLVBars( Low, 10 ) == 0;
endi = -1;
starti = -1;
dir = 0;
for ( i =0 ;i<BarCount ; i++)
{
VH[i]=Hp[i];
VL[i]=Lp[i];
}
for( i = BarCount-1; i >= 0; i-- )
{
if( dir == 1 && VL[i] )
{
// FillLine(ZigHilo,i, Low, endi, endval);
for( j = i; j <= endi; j++ )
{
HiLo[ j ] = Low[i] + ( j - i) * (endval-Low
[i])/( endi -i );
}
endi = i;
endval = Low[ i ];
dir = -1;
}
else if( dir == -1 && VH[i]/*HiV[ i ]*/ )
{
// FillLine(ZigHilo,i, High, endi, endval );
for( j = i; j <= endi; j++ )
{
HiLo[ j ] = High[i] + ( j - i) * (endval-High
[i])/( endi -i );
}
endi = i;
endval= High[ i ];
dir = 1;
}
else if( dir == 0 && endi == -1 && VL[i] )
{
endi = i;
endval = Low[ i ];
dir = -1;
}
else if( dir == 0 && endi == -1 && VH[i])
{
endi = i;
endval = High[ i ];
dir = 1;
}
}
for(i=0; i<BarCount;i++)
{
if(HiLo[i]<=0)
HiLo[i]= Null;
}
Plot(Hilo,"",2,1);
Plot(C,"",1,64);
////////////////////END////////////////////////////
> Thanks for your response. I haven't had a chance to go through
your
> code thoroughly, as there's a lot there, but the impression that I
am
> getting is that I'll have to loop through all the bars and build an
> array (or series of arrays) to store the pivot information as you
> suggested. As far as I can see there's no way to use standard
array-
> style AFL.
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Gordon" <amibroker@xxxx> wrote:
> > Hi David,
> >
> > I haven't had a chance to fun your code yet, but I did want to
let
> > you know that I wrote some code for identifying swing highs and
> lows
> > and uploaded it to the AFL library. Part of the code was setting
up
> > arrays that held the barindex of the pivots as well as the
prices,
> > making it easy to determine the number of bars and pct. change
> > between pivots. You'll find it under "Gordon Rose" since, when
the
> > dialog box for adding the code asked for a name, I dutifully
> entered
> > mine instead of that of the function!
> >
> > There is also a DLL that has a number of pivot-related routines
in
> > it. I believe that is in the files section of this bbs.
> >
> > Good luck.
> >
> > Gordon
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/
|