PureBytes Links
Trading Reference Links
|
Anthony,
Thank you for your efforts, but I think it does not work the wanted
way (ZigZag from High to Low).
B Rgds
--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> /* criteria for high and low pivot */
>
> HP = IIf( H < Ref(H,-1) AND Ref(H ,-1) > Ref(H ,-2) AND Ref(H ,-1) >
Ref(H
>
> ,-3), 1, 0);
>
> LP = IIf( L > Ref(L ,-1) AND Ref(L ,-1) < Ref(L ,-2) AND Ref(L ,-1)
< Ref(L
>
> ,-3), 1, 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;
>
> Graph1Style=64;
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar. <br> Now with
Pop-Up Blocker. Get it for free! <br> http://companion.yahoo.com
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/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
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/
|