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

Re: [amibroker] little piece of code



PureBytes Links

Trading Reference Links

Nice little piece of code, Ed.  I am new to AFL coding and will try to 
figure out what you did and why.  So i will be using your code as a 
learning tool.

Thanks,
Alann

At 11:00 AM 11/8/04 +0100, you wrote:

>previous subject line was in error ....
>
>in my attemps to make a trend following systems I made this little piece 
>of code pure for visualisation. Put is in the Ind. Builder and click 
>somewhere in the chart with the mouse.
>
>rgds, Ed
>
>/*
>
>trend channel development
>
>Edward Pottasch, nov 2004
>
>*/
>
>
>per = 10;
>mm= (H + L) / 2;
>
>x = Cum(1);
>lastx = LastValue( x );
>selv = SelectedValue(x);
>
>aaa = LinRegIntercept( mm, per);
>bbb = LinRegSlope( mm, per );
>
>daa = SelectedValue(ValueWhen( x, aaa, 1));
>dbb = SelectedValue(ValueWhen( x, bbb, 1));
>
>xx = IIF(x > selv - per AND x <= selv, x - (selv - per),null);
>yy = daa + dbb * xx;
>
>detrend = mm - yy;
>wd = SelectedValue(HHV(abs(detrend),per));
>
>Plot(yy, "LinReg", colorBlue );
>Plot(yy + wd, "Upper Boundary", colorRed );
>Plot(yy - wd, "Lower Boundary", colorBrightGreen );
>
>Plot(C,"",colorwhite,64);
>
>[Non-text portions of this message have been removed]
>
>
>
>
>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
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/