Skip to main content

Slope of Regression Line & Standard Error Exploration for Amibroker (AFL)

mohangbox over 8 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 2)
  • Tags:
    amibroker, exploration

This formula displays the slope (in degrees) of a linear regression line and the standard error of the linear regression line in two columns. This is an exploration only. It is useful for finding trending stocks. The steeper the slope the faster the trend. The lower the error the more clear and stable the trend is.

Indicator / Formula

Copy & Paste Friendly
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//*************************************************Slope of Regression Line(in degrees) & Standard Err of of RS Line(%)*********************************
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Daysback = Param( "Days Back", 126, 30, 252, 1 );
bb = LastValue( LinRegSlope(C, Daysback ));
pi = 4 * atan(1);
slopeangle = atan( bb ) * ( 180 / pi );

Filter = 1;

AddColumn(slopeangle,"In degrees", colorDefault, colorBlue);
AddColumn(StdErr( 100 * Close, Daysback ),"Std.Err RS Line(%)", colorDefault, colorBlue);

2 comments

Leave Comment

Please login here to leave a comment.