LinearReg

Statistical functions 
SYNTAX  LinearReg( ARRAY, periods ) 
RETURNS  ARRAY 
FUNCTION  Calculates linear regression line endpoint value according to a + b * x (where a and b are intercept and slope of linear regression line) from the ARRAY using periods range. The function accepts periods parameter that can be constant as well as timevariant (array). 
EXAMPLE  LinearReg( close, 10 ); 
SEE ALSO 
The LinearReg function is used in the following formulas in AFL online library:
See updated/extended version online.