[pshaiCmd] Linear Regression TradingView style (linreg)

0 531 Views No Comments 1 year ago
  • 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)
    
    HaasScript Code
    Sign in or Register to download for free
  • Earn Up to 2,000 $BMEX Tokens Promotion Type: contest Expires: July 31, 2023 Exclusive
    Fire up your trade bots and earn up to 2,000 $BMEX, $BTC, free subscriptions, and more.
Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free