Skip to content
Typed Trader

Linear Regression (LINREG)

Fits a straight line to recent prices using least-squares. The prediction is the point on the line at the latest bar; the slope indicates trend direction and strength.

Live Demo

Pick a market regime to see how LINREG(14) reacts:

Usage

import {} from 'trading-signals';
 
// LinearRegression yields results once 14 inputs have been added
const  = new (14);