mks17

Linear Regression Channels

This script tries to find when a trading channel is developing and once is developed it will save it for later use on 2 variables up and down channel. You can access the last 2 channels for comparisons but this could be extensible for more channels.

You can choose the delta for the alignment accuracy of the channel.
The error for the difference between channels and the deviation for the width of the channel based on standard deviation.

Offset is for the alignment basically if the alignment is the same at the begining and at the offset the algo consider that a Channel.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

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.

Want to use this script on a chart?