TradingView
dgtrd
2021년 4월 19일 오전 9시 36분

Linear Regression Channel / Curve / Slope by DGT 

Bitcoin / TetherUSBinance

설명

Tʜᴇ Lɪɴᴇᴀʀ Rᴇɢʀᴇꜱꜱɪᴏɴ Cʜᴀɴɴᴇʟꜱ

Linear Regression Channels are useful measure for technical and quantitative analysis in financial markets that help identifying trends and trend direction. The use of standard deviation gives traders ideas as to when prices are becoming overbought or oversold relative to the long term trend

The basis of a linear regression channel

   Linear Regression Line – is a line drawn according to the least-squares statistical technique which produces a best-fit line that cuts through the middle of price action, a line that best fits all the data points of interest. The resulting fitted model can be used to summarize the data, to predict unobserved values from the same system. Linear Regression Line then present basis for the channel calculations



The linear regression channel

   2. Upper Channel Line – A line that runs parallel to the Linear Regression Line and is usually one to two standard deviations above the Linear Regression Line.
   3. Lower Channel Line – This line runs parallel to the Linear Regression Line and is usually one to two standard deviations below the Linear Regression Line.

Unlike Fibonacci Channels and Andrew’s Pitchfork, Linear Regression Channels are calculated using statistical methods, both for the regression line (as expressed above) and deviation channels. Upper and Lower channel lines are presenting the idea of bell curve method, also known as a normal distribution and are calculated using standard deviation function.
A standard deviation include 68% of the data points, two standard deviations include approximately 95% of the data points and any data point that appears outside two standard deviations is very rare.

It is often assumed that the data points will move back toward the average, or regress and channels would allow us to see when a security is overbought or oversold and ready to revert to the mean



please note : Over time, the price will move up and down, and the linear regression channel will experience changes as old prices fall off and new prices appear


█  Linear Regression Study Features

Linear Regression Channel
    - Linear regression line as basis
    - Customizable multiple channels based on Standard Deviation
    - ALERTs for the channel levels




Linear Regression Curve
    - Linear regression curve as basis
    - Optional : Bands based on Standard Deviation or Volatility (ATR). Bands are applied with fixed levels 1, 2 and 3 times StdDev or ATR away from the curve




Linear Regression Slope
    - Optional : Up/Down slope arrows for a used defined period




█  Volume / Volatility Add-Ons
High Volatile Bar Indication

Volume Spike Bar Indication

Volume Weighted Colored Bars


릴리즈 노트

default slope input length value reduced

Disclaimer:
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely

The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script

릴리즈 노트

added ability to plot second Linear Regression Channel

Default lookback period (count) of Linear Regression Channel values are set as
1st Channel - 200
2nd Channel - 50

릴리즈 노트

update

added ability to plot higher time frame ("1D",, "4H", and "1H") linear regression channel on intraday bar. option is available with the second linear regression channel, please check details in the tooltip option with usage info

ability to set period to maximum allowed lenght (5000)

릴리즈 노트

update

* enhanced label customization options
* alert additions, First Linear Regression Median Line versus Second Linear Regression Median and Deviation Line crosses
* Pine v5
코멘트
Daveatt
Masterpiece !!!
dgtrd
Thank You @Daveatt, so happy to receive appreciation from a Master
Mr_JohnWick
Exactly What I was Looking For!
Can you add custom Interval option for std deviation lines eg D or W etc
dgtrd
@Mr_JohnWick, thank you, count input option is the length (lookback period) of linear regression line and its channels. is your request to have option to draw them fixed length, such as previous day long or previous week long. can you please aslo share an snapshot with use cases
Mr_JohnWick
@dgtrd, I Mean if you can provide Option to fix Channel on Particular timeframe, for e.g User can choose time frame of channel say 15 min so same channel can be viewed on Lower timeframes
dgtrd
@Mr_JohnWick, thank you a lot for your valuable suggestion, i wll study this use case
dgtrd
hello @Mr_JohnWick, is it something like this
Stockguy0415
@dgtrd, Hi DGTRD, your scripts are some of the best on this site, you're truly a master. Thank you for your tireless work and talent! I love your auto pitchfork indicators, but I humbly request that you add something like this to your auto pitchfork indicator. I exclusively prefer to use pitchforks for trading, but would really love the ability to lock your pitchfork to a specified resolution. Often I would like to trade the 20 minute chart, but be able to have the entire thing framed within say, a 4 hour pitch fork. As the indicator can't always pick which of the pitchforks (Andrew's, Schiff, Mod-Schiff, and Inside) is the most appropriate to use, I sometimes add all 4 of your auto pitchforks so that I can pick what I feel is the best one, but then if I go down a time frame to trade it, all of the indicators change. The ability to specify a time frame as well as a pitchfork type and possibly even the ability to lock it (so that it doesn't redraw once a new candle forms) would be incredible! Please and thank you <3
더보기