PureBytes Links
Trading Reference Links
|
Thank you Anthony and DT,
you gave me some good code to work with. Will let you know how it works out.
herman
-----Original Message-----
From: Anthony Faragasso [mailto:ajf1111@xxxxxxxx]
Sent: Thursday, September 04, 2003 6:20 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] SignalZig
Herman,
Can you adapt this formula....
/* SWING CHART */
SetBarsRequired( 200, 200 ); // needed for script
swingsize = 10;
HP = HHVBars( High, swingsize ) == 0;
LP = LLVBars( Low, swingsize ) == 0;
EnableScript("jscript");
<%
result = VBArray(AFL("High")).toArray();
function TrendLine( starti, startv, endi, endv )
{
for( j = starti; j <= endi; j++ )
{
result[ j ] = startv + ( j - starti )*(endv-startv)/(endi-starti);
}
}
High = VBArray(AFL("High")).toArray();
Low = VBArray(AFL("Low")).toArray();
HP = VBArray(AFL("HP")).toArray();
LP = VBArray(AFL("LP")).toArray();
endi = -1;
starti = -1;
dir = 0;
for( i = High.length - 0; i >= 0; i-- )
{
if( dir == 1 && LP[ i ] )
{
TrendLine( i, Low[ i ], endi, endv );
endi = i;
endv = Low[ i ];
dir = -1;
}
else
if( dir == -1 && HP[ i ] )
{
TrendLine( i, High[ i ], endi, endv );
endi = i;
endv = High[ i ];
dir = 1;
}
else
if( dir == 0 && endi == -1 && LP[ i ] )
{
endi = i;
endv = Low[ i ];
dir = -1;
}
else
if( dir == 0 && endi == -1 && HP[ i ] )
{
endi = i;
endv = High[ i ];
dir = 1;
}
}
AFL("Graph0")=result;
%>
Graph0Color=colorRed;
Graph1=Close;
Graph1Color = colorBlack;
Graph1Style=styleCandle;
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 8/28/2003
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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
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
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
|