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

[amibroker] Re: Exploration for tight rising channels



PureBytes Links

Trading Reference Links

Johan,

I may have been over-enthusiastic in thinking that your code worked 
as I had planned. The numerator (Direction) is fine. I'm not sure 
that the denominator (Volatility) is working as planned. It's 
definitely close.

Assuming that the calculation for the "scatter" at the last point on 
the linear regression line should be abs(Close - End), shouldn't the 
following line return the same value for "Volatility" (the sum of the 
scatter) at the last/end point?

AddColumn(Sum(abs(Close-end),40),"Volatility Check");


--- In amibroker@xxxxxxxxxxxxxxx, Tim Gadd <timgadd@xxx> wrote:
>
> Yes, Johan, that is it! Thanks.
> 
> I'll post the final version for my tight rising
> channel screen as soon as I get it done (after
> spending the weekend trying to figure out how i can
> reduce my 2005 tax liability by about $850).
> 
> Thanks again!
> 
> --- johsun <joh.sun@xxx> wrote:
> 
> > Could this be what you are looking for:
> > 
> > 
> > 
> > Periods = 40;
> > 
> > end = LinearReg( C, periods );
> > start = LinRegIntercept( C, periods );
> > slope = LinRegSlope( C, periods );
> > 
> > for( n = x = 0; n < periods; n++ ) 
> > x = x + abs( Ref( C, - n ) - ( end - n * slope ) );
> > 
> > Direction = end - start;
> > Volatility = x;
> > 
> > ER = Direction / Volatility;
> > 
> > Plot( er, "er" , colorRed );
> > 
> > Filter = 1;
> > AddColumn( er, "er" );
> > 
> > 
> > 
> > 
> > Regards
> > Johan
> > 
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "timgadd"
> > <timgadd@> wrote:
> > >
> > > I'd like to employ a variation of Kaufman's
> > Efficiency Ratio to 
> > help 
> > > screen for stocks in tight rising channels.
> > Specifically, I'd like 
> > to 
> > > compare a stock's ROC weighted by it's Efficiency
> > Ratio to that of 
> > a 
> > > market index to screen out stocks that are
> > outperforming the index 
> > on 
> > > a volatiliy adjusted basis. (I realize there are
> > other ways to 
> > > approach this, but I'd like to try this approach).
> > > 
> > > The standard version of the Efficiency Ratio is
> > defined as the 
> > > absolute value of direction over volatility where
> > ...
> > > 
> > >      Direction = C - Ref(C, -periods);
> > >      Volatility = Sum(Abs(ROC(C,1), periods);
> > > 
> > > I'd like, instead, to define Direction as the last
> > (y) value of a 
> > > static (non-moving) linear regression line minus
> > the first (y) 
> > value 
> > > of the static linear regression line.
> > > 
> > > I'd like to define Volatility as the "scatter" at
> > each point along 
> > > the static linear regression line ... something
> > like ...
> > > 
> > >      Sum(Abs(C - LinearReg(C, periods)), periods);
> > > 
> > > ... except that this uses the moving linear
> > regression 
> > calculation. 
> > > I'd like to keep the start point of the regression
> > line constant 
> > so 
> > > that I can measure the efficiency ratio from a
> > static reference 
> > point 
> > > (a technical low).
> > > 
> > > I've stumbled through some code for a static
> > linear regression 
> > line 
> > > (link below), but cannot figure our how to
> > determine the beginning 
> > > and ending points.
> > > 
> > >
> >
> http://www.amibroker.com/library/detail.php?id=193&hilite=LASTVALUE
> > > 
> > > Any suggestions?
> > >
> > 
> > 
> > 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com
>







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

 
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/