With those settings I do not see there being a buy or sell on the chart since the close price is not out of the bands anywhere

 

Am I missing something?


Mark

 


From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of emp62
Sent: Saturday, March 04, 2006 4:23 PM
To: amibroker@yahoogroups.com
Subject: Re: [amibroker] Help with Kirshenbaum indicator

 

hi,

 

I changed 1 line in the code. I think it is good now. See chart below which resembles your original chart very good (settings I use for that chart are: 5, 7, 4.5)

 

code:

 

SetBarsRequired(10000,10000);
PPeriod =
Param( "P Period", 12, 2, 100, 1 );
LPeriod =
Param( "L Period", 12, 2, 100, 1 );
NPeriod =
Param( "N Period", 2, 0, 10, 0.25 );
Bandwidth =
0;

EmaP =
EMA(C,PPeriod);

aaa =
LinRegIntercept(C, LPeriod);
bbb =
LinRegSlope(C, LPeriod);

for (i = LPeriod; i < BarCount; i++) {
      
   AE =
0;
   
for (j = 0; j < LPeriod; j++) {
   
      
// calculate point on regression line
      RegPoint = aaa[ i ] + bbb[ i ] * j;
      
      
// calculate the standard error using the distance from line
      AE = AE + (C[ (i - LPeriod) + j +
1 ] - RegPoint) ^ 2;
   
   }
   
// standard error
avErr = (AE / LPeriod) ^
0.5;

// save the bandwidth
Bandwidth[ i ] = avErr * NPeriod;

}

SetChartOptions(0, chartShowDates);
GraphXSpace =
5;
Plot(C,"",colorWhite,64);
Plot(EmaP,"",colorWhite,1);
Plot(EmaP + Bandwidth,"",colorRed,1);
Plot(EmaP - Bandwidth,"",colorBrightGreen,1);




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS




Reply via email to