Linear Regression
Under the Hood
LINEARREG calculates a least-squares linear regression line through price data over a specified period (default 14), providing the best-fit straight line that minimizes the sum of squared deviations. Unlike simple moving averages, LINEARREG emphasizes recent data mathematically through regression weighting. The output is the current value of the regression line, which acts as a trend indicator. This statistical approach to trend identification treats the trend as the slope and position of a mathematically fitted line rather than a simple average.
In Practice
Cryptocurrency traders use LINEARREG as a mathematically precise trend indicator and moving average alternative. When price crosses above LINEARREG, it signals bullish momentum; crossing below indicates bearish pressure. LINEARREG responds faster to trend changes than simple moving averages due to its regression-based calculation. It's particularly effective combined with LINEARREG_SLOPE (trend strength), LINEARREG_ANGLE (trend steepness), or TSF (forecast extension). Traders often use LINEARREG as dynamic support/resistance or as a trend filter for other strategies. It's popular among quantitative traders preferring statistical indicators over traditional technical analysis.
Build automated strategies using Linear Regression Line and hundreds of other indicators. Connect to your favourite exchange and let the bot execute trades 24/7 — no code required.