Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

  • Forums
  • Pinescript
  • Tradingview - Pine Script - How is regression channel can be replicated in excel.

Tradingview - Pine Script - How is regression channel can be replicated in excel.

Aug 23, 2022 - 11:40 AM

Viewed 2565 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/394888 COPY
  • Dear ALL Pine Script Experts,
    I seek your views on how is it possible to generate linear regression channel (2 Std Dev range) in Excel or google sheet.
    Linear regression function is available in both. But 2SD values calculated are not matching values shown in chart.

    Theoretically, What can be steps for calculating SD of regression line.

    If anyone give inputs I will work around and share sheets to see if results matches with Tradingview
    regression channel Std Dev.

    Thanks
    Robin

    Linear Reg in chart.png

    Linear Reg in Sheet.png

    0
  • Hey Robin

    Check if the linereg formula (https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}linreg) is the same as the one used in Excel

    linreg = intercept + slope * (length - 1 - offset), where intercept and slope are the values calculated with the least squares method on source series.

    0
CONTENTS