Analysis Techniques & Strategies
Name | Expression | Default | Description |
Length | Numeric | 30 | Number of bars used to calculate linear regression. |
EndDate | 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 | Numeric | 0 | Optional input used with EndDate specifying the time (in 24 hour HHMM format) for the endpoint of the linear regression line.. If 0, the time is ignored. |
Color | Numeric | Yellow | Specifies the color of the linear regression line. |
ExtRight | True/False | true | Determines whether to extend the linear regression line to the right of the EndDate/EndTime bar (True) or stop at the bar (False). |
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.
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.