Linear Regression
Linear regression is a statistical technique that finds the straight line that best fits a set of data points, describing the relationship between an independent variable (the input, often time) and a dependent variable (the output, often price). The line is calculated using the "least squares" method, which minimizes the total squared distance between the line and every actual data point, giving a single best-fit trend line through what might otherwise look like scattered, noisy data.
In trading platforms, a linear regression line drawn across, say, 50 days of a stock's closing prices produces an objective trend line with a defined slope (how steep the trend is) and an equation that can be extended forward to project where price "should" be if the trend continues unchanged. If a stock's 50-day linear regression line has a slope showing an average gain of $0.80 per day and the current price is $120, the line projects to roughly $124 five trading days later - not a prediction of certainty, but a mathematically objective baseline, in contrast to a hand-drawn trendline that varies from one trader to the next.
A closely related tool is the linear regression channel, which plots parallel lines a set number of standard deviations above and below the central regression line, creating a statistical "normal range" for price. Traders use a break above or below this channel as a signal that price is moving unusually far from its recent statistical trend - potentially signaling either an accelerating trend or an overextended, mean-reversion-prone move.
Linear regression is also the mathematical basis for calculating beta, the measure of how much a stock or asset tends to move relative to a broader index - beta is literally the slope of the regression line when you plot a stock's daily returns against the market's daily returns. The method is general statistics rather than market analysis, which is why charting platforms offer it as a built-in drawing tool and why the same arithmetic sits underneath beta, factor models and a great deal of academic finance. What changes between one application and the next is not the calculation but what is put on each axis, and that choice is where the judgement actually is.
The channel drawn around the line deserves more scepticism than it usually receives, because the word standard deviation imports a statistical guarantee that the underlying method does not deliver here. Least squares produces its best results when the deviations from the line are independent of one another, roughly equal in size across the window, and unrelated to what came before. Price series violate all three in the same characteristic way: large deviations arrive in clusters, they are much larger in volatile periods than in calm ones, and today's is strongly related to yesterday's. The fitted line itself survives this reasonably well, since it is only describing the average direction of the window. The bands do not, because their width is computed as though the errors behaved. In practice price spends noticeably more time outside a two deviation channel than the arithmetic behind the number would suggest, which matters to anyone treating a touch of the outer band as a rare event.