OPEN-SOURCE SCRIPT

Linear Regression Trend bands

9 346
code from linear regression used
Linear Regression Trend Channel


So it just to make bands from it
uptrend blue color , down trend red color
I suggest you try to fix length to best optimum ( I put it on 200, but other length may be better)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.