Statistic Functions

Linear Regression Line (LINEARREG)

Linear Regression

Deep Dive

Everything You Need to Know

Under the Hood

How It Works

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

How Traders Use It

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.

Highlights

LINEARREG at a Glance

Least-squares linear regression through price data
Best-fit trendline using statistical methods
More responsive than simple moving averages
Price crossovers generate trend change signals
Default 14-period calculation
Acts as dynamic support/resistance level
Foundation for TSF (adds forecast projection)
Best combined with LINEARREG_SLOPE or ANGLE
Popular among quantitative and statistical traders

Get Started

Automate LINEARREG with cryptorobot.ai

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.