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

[amibroker] Standard Error bands - Indicator



PureBytes Links

Trading Reference Links




Hi,
 
Just sharing some code that I 
originally found on this forum (somewhere) and was subsequently found to be 
wrong. Tomasz has made the corrections so here it is. I've also 
added it to the AFL library on the AmiBroker web site.
 
<FONT 
color=#008000>/* Standard Error Bands */<FONT 
face="Courier New"> Var= <FONT 
color=#0000ff>Param(<FONT 
color=#ff00ff>"Standard Error", <FONT 
color=#ff00ff>18, <FONT 
color=#ff00ff>1, <FONT 
color=#ff00ff>100, <FONT 
color=#ff00ff>1<FONT 
color=#000000>); Periods= Param<FONT 
color=#000000>("Periods", 
3, <FONT 
color=#ff00ff>1, <FONT 
color=#ff00ff>100, <FONT 
color=#ff00ff>1<FONT 
color=#000000>); <FONT color=#800000 
size=2>function<FONT 
color=#000000> SteBand( array, periods, upper ) {   Lr = 
LinearReg<FONT 
face="Courier New">( array, periods ); 
  se = StdErr<FONT 
face="Courier New">( array, periods ); 
  return<FONT 
color=#000000> LR + IIf( 
upper, 1, -<FONT 
color=#ff00ff>1 ) * <FONT 
color=#ff00ff>2<FONT 
color=#000000> * se; } upperstderrband = SteBand( <FONT 
color=#000000>C, Var, <FONT 
color=#000000>True<FONT 
size=2> ); lowerstderrband = SteBand( <FONT 
color=#000000>C, Var, <FONT 
color=#000000>False<FONT 
size=2> ); midstderrband = (upperstderrband + 
lowerstderrband )/2<FONT 
face="Courier New">; <FONT 
color=#0000ff>Plot(upperstderrband ,<FONT 
color=#ff00ff>"upperstderrband ",<FONT 
color=#000000>colorGreen,<FONT 
color=#ff00ff>4<FONT 
color=#000000>); Plot<FONT 
color=#000000>(Close<FONT 
color=#000000>,"Close"<FONT 
color=#000000>,colorBlack<FONT 
color=#000000>,<FONT 
color=#000000>styleCandle<FONT 
face="Courier New">); <FONT 
color=#0000ff>Plot(lowerstderrband ,<FONT 
color=#ff00ff>"lowerstderrband ",<FONT 
color=#000000>colorRed,<FONT 
color=#ff00ff>4<FONT 
color=#000000>); Plot<FONT 
color=#000000>(midstderrband ,"midstderrband 
",<FONT 
color=#000000>colorBlack ,<FONT 
color=#000000>styleLine<FONT 
face="Courier New">); <FONT 
color=#000000>GraphXSpace = <FONT 
color=#ff00ff>3; 

Regards,William Peters<A 
href="">www.amitools.com
 


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 the Yahoo! Terms of Service.