Linear Reg Line (Indicator)

Disclaimer

Input Information

Name Expression Default Description
Price Numeric Close Price used in the linear regression calculation
Length Numeric 30 Number of bars used to calculate linear regression.
EndDate_YYMMDD Numeric 0 Optional input specifying the date of a bar (in YYYMMDD format) for the endpoint of the linear regression line.  If 0, the endpoint is the last bar at the time the indicator is applied.
EndTime_HHMMSS String "16:00:00" Optional input used with EndDate specifying the time (in 24 hour HHMMSS format) for the endpoint of the linear regression line..  If 0, the time is ignored.
TrendlineColor Numeric Yellow Specifies the color of the linear regression line.
ExtRight Numeric 1 Determines whether to extend the linear regression line to the right of the EndDate/EndTime bar (1) or stop at the bar (0).

Market Synopsis

Linear regression is a statistical technique that uses the least squares method to fit a straight line to data points. In market analysis, a linear regression line is commonly used to predict future market values relative to their past values, and is plotted on a price chart as a straight line, similar to a trendline.

The Linear Reg Line indicator helps to determine where a market's price might be in the near future using current and past price history. If prices are trending up, linear regression attempts to logically determine what the upward bias of the price may be relative to the current price. If prices are trending down, it will attempt to determine the downward bias of the price. Some analysts believe that when prices rise above or fall below the linear regression line, they are overextended and will begin to move back towards the line. Thus, the line is used to monitor when a price move may change direction.

Plot Information

This indicator does not plot a line or histogram, rather, it plots a trendline displayed in the same subgraph as the price data. The trendline's default color is yellow.

Related

LinearRegValue

LastBarOnChartEx