PureBytes Links
Trading Reference Links
|
Hello,
I believe someone mentioned that the High Low Zig Zag indicator I
previously put on this web site didn't go all the way to the end of
the price data. Anyway I finally had an application that required
it to go to the end of the price data (double bottom exploration)
and have modified it to do so. Please see below.
Aequalsz
function FillLine( startbar, startval, endbar, endval )
{
global ZigArray;
for( j = startbar; j <= endbar; j++ )
{
ZigArray[ j ] = startval + ( j - startbar) * (endval-
startval)/( endbar -startbar );
}
return;
}
WavePcnt = Param("Percent",15.0,1.0,100,0.1);
RP = ( High[0] + Low[0] )/2.0;
RPPoint = 0;
RP0 = RPPoint;
RP1 = RP;
RPPoint1 = RPPoint;
Switch = 0;
for(i=0; i<BarCount; i++)
{
ZigArray[i] = -1.0E10;
// Swing High
if( i>0 AND i<BarCount-2 AND H[i]>=H[i-1] AND H[i]>=H[i+1] )
SH = H[i];
else
SH = -1;
// Swing Low
if( i>0 AND i<BarCount-2 AND L[i]<=L[i-1] AND L[i]<=L
[i+1] )
SL = L[i];
else
SL = -1;
// ZigZag
if( SH != 0 )
{
if(Switch != 1 AND SH >= RP*(1+0.01*WavePcnt) )
{
RPPoint1 = RPPoint;
RP1 = RP;
RPPoint = i;
RP = SH;
FillLine( RPPoint1, RP1, RPPoint, RP );
Switch = 1;
}
else
if(Switch == 1 AND SH >= RP)
{
RPPoint = i;
RP = SH;
FillLine( RPPoint1, RP1, RPPoint,
RP );
}
}
if( SL != -1 )
{
if(Switch != -1 AND SL <= RP*(1-0.01*WavePcnt) )
{
RPPoint1 = RPPoint;
RP1 = RP;
RPPoint = i;
RP = SL;
FillLine( RPPoint1, RP1, RPPoint, RP );
Switch = -1;
}
else
if(Switch == -1 AND SL <= RP )
{
RPPoint = i;
RP = SL;
FillLine( RPPoint1, RP1, RPPoint,
RP );
}
}
}
// Last line segment
RPPoint1 = RPPoint;
RP1 = RP;
RPPoint = BarCount - 1;
if(Switch == -1) RP = LastValue(High);
if(Switch == 1) RP = LastValue(Low);
FillLine( RPPoint1, RP1, RPPoint, RP );
Plot(Close,"Prices",colorBlack,styleCandle);
Plot(ZigArray,"ZA",colorWhite,styleLine+styleThick);
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/
|