- DarkLight
Linear Regression Channel
- DarkLight
Linear Regression Channel is an indicator used to analyze the upper and lower limits of an existing trend. The channel consists of three lines: upper channel and lower channel lines that mark the top and bottom of the trend, and linear regression line, which is used to determine the trend direction. The linear regression line is based on the linear regression algorithm which makes the line more responsive to the prices than the classic moving averages. The prices above the linear regression line make up the bearish trend, and the ones below the linear regression line indicate the bullish trend.
The formula uses the sum of least squares method to find a straight line that best fits data for the selected period. The end point of the line is plotted and the process repeated on each succeeding day.
y = a + bx
b = (nΣxy - ΣxΣy) / ( nΣx2 - (Σx)2 ))
a = (Σy - bΣx) / n
where:
y – the data price source
x – the number of bars
a – the constant (the value when x equals zero)
b – the slope of the line
n – the number of data points selected
INPUTS
Input | Description |
---|---|
Length | The number of bars used during the calculation |
Price |
---|
The following data sources are available for calculation of the channel lines:
|
Input | Description |
---|---|
Width | The width of the channel in px |
PLOTS
The plot renders the data you are working with on the chart. You can show/hide a plot by clicking the corresponding item in the settings. Every plot has a set of basic settings that you can change: color, weight, and type.
Plot | Description |
---|---|
Lower | The lower channel plot |
LinReg | The linear regression plot |
Upper | The upper channel plot |
Color |
---|
Click the color rectangle under the plot's name to open the palette. Use the slider at the bottom to set the opacity of the color. To create a custom color:
The custom-created colors are added to your palette. To remove a custom color, drag it out of the palette. |
Weight |
Change the value (in px) to adjust the thickness of the plot. |
Type |
The following plot types are available:
|
OVERLAYING
Check Overlaying to display the indicator on the chart. Otherwise, the indicator is shown in a study pane down below.