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

[amibroker] Linear Trend with Automatic Start Point



PureBytes Links

Trading Reference Links

I would like to have a trend line drawn using the last buy/sell signal
as the starting point.  I have not been able to figure out how to do
that and would like some suggestions.  Here is what I tried, which has
not gotten an error message, but it has not produced anything either.
 I know the rest of the code works to draw a line and the only thing
I'm manipulating is the daysbackb variable.  Can this work without a
lot of complex coding?
.
.
.
Daysbackb = LastValue(LowestSinceBars( Buy, C)); 
shift = Param("Look back period",0,0,50000,1); 
xb = Cum(1);
lastxb = LastValue( xb ) - shift; 
ab = LastValue( Ref(LinRegIntercept( p, Daysbackb), -shift) ); 
bb = LastValue( Ref(LinRegSlope( p, Daysbackb ), -shift) ); 
yb = Ab + bb * ( xb - (Lastxb - DaysBackb +1 ) ); 
.
.
.

Thanks for any help.

Chuck



Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006