Editors' picks
OPEN-SOURCE SCRIPT

Linear Regression Channel

Updated
Hello Traders,


There are several nice Linear Regression Channel scripts in the Public Library. and I tried to make one with some extra features too. This one can check if the Price breaks the channel and it shows where is was broken. Also it checks the momentum of the channel and shows it's increasing/decreasing/equal in a label, shape of the label also changes. The line colors change according to direction.

using the options, you can;
- Set the Source (Close, HL2 etc)
- Set the Channel length
- Set Deviation
- Change Up/Down Line colors
- Show/hide broken channels
- Change line width

meaning of arrows:
⇑ : Uptrend and moment incresing
⇗ : Uptrend and moment decreasing
⇓ : Downtrend and moment incresing
⇘ : Downtrend and moment decreasing
⇒ : No trend

An example for how color of lines, arrow direction and shape of label change.
snapshot



Enjoy!
Release Notes
Added an option "Show Fibonacci Levels", it can show Fibonacci levels of the channel. and also added alert (before someone asked me to add alert :)

Example: Fibonacci Levels
snapshot
Release Notes
Two new alerts added:
-> Up trend
-> Down trend
(users request)
Release Notes
added color option for broken lines
breakoutlinear-regressionLinear RegressionlonesometheblueMoving AveragesSupply ZonesupportTrend Line BreaktrendreversaltrendtradingVolatility

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 publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer