LinearRegSlope (Function)

image\trumpet2.gif Disclaimer

Linear Regression is a concept also known as the "least squares method" or "best fit." Linear Regression attempts to fit a straight line between several data points in such a way that distance between each data point and the line is minimized.

Function

LinearRegSlope(Price, Length)

Parameters

Name

Type

Description

Price

Numeric

Specifies the value of interest is to be used.

Length

Numeric

Specifies the number of bars to consider in the regression calculation.

Returns

A numeric value containing the slope of the current regression line.

Usage

The input Price can be hard coded with a bar attribute such as Close, Open, High, Low, and Volume or a numeric series type input. It can also be replaced with a valid EasyLanguage expression. For example: Close + Open, or Average(RSI(Close,14),14).

The input Length can be hard coded replaced with a numeric simple type input.