-
Linear Regression calculated the same way as TradingView does, using LR_Intercept and LR_Slope types.
Example/Usage:
local c = ClosePrices() local linreg1 = CC_LinReg(c, 50, 0) local linreg2 = CC_LinReg(c, 50, 25) local linreg3 = CC_LinReg(c, 50, -25) Plot(0, 'linreg1', linreg1, White) Plot(0, 'linreg2', linreg2, Orange) Plot(0, 'linreg3', linreg3, Purple)