TradingView
corgalicious
2020년 9월 28일 오전 10시 39분

Responsive Linear Regression Channels 

Invesco QQQ Trust, Series 1NASDAQ

설명

This is a linear trend indicator that can:
- automagically adjust to different chart resolutions
- snap to day/session boundaries on intraday
- totally not do the above and use ye olde good fixed lookback window
- show the regression trend and its RMSE channels
- disregard the trend and just show the period average and standard deviation lines (often acting as support and resistance)

The main idea was to allow you to quickly view linear trends for different time periods without having to calculate the required amount of bars.
By default, you will be able to quickly switch between 1-3 months, 6 months, 1 year, 2 years and 5 years of data, as well as various daily lookback periods.
Please adjust resolution settings to your liking.

Caveats:
- More data means more noise and slower calculations.
- HLC3 source is recommended, especially at resolutions above hourly.
- Trend will be slightly different if you use extended hours.
- If you use extended hours and don't have a data subscription, trend will be SUBSTANTIALLY different, especially at smaller resolutions like 1m.
- You might want to use 3.5 days per week for crypto (it's 7 days by default).

Known problems:
- If you can't see the trendlines, scroll to the left or zoom out - the origin could be outside of your viewport.
- Futures' sessions start on the previous day. We currently snap only to day boundaries, not session breaks.
- UVXY and the like that have extremely high price datapoints. The calculations will be wrong on some resolutions.
- Replay can freeze circa bar_index 244 — disable smart lookback and keep your window under 240 bars if you encounter this.

ACKNOWLEDGEMENTS:
Many thanks to alexgrover for his extremely efficient functions (used with permission)
코멘트
PineCoders
mperdue
Great job
PineCoders
This publication is now featured in our Editors' Picks. In the name of all TradingView traders, thank you for your valuable contribution to the TradingView community, and congrats!
corgalicious
@PineCoders, wow thanks! It's an honor!
JS009
Does this work on all time frames?
corgalicious
@JS009, yes, it's literally what this indicator is for
thabeger
@corgalicious, I cannot get this to work on 5 min. crypto's..........
corgalicious
@thabeger, try zooming the chart out a bit
thabeger
@corgalicious, Got it! How can I make this on a 5 day period? I tried using the settings but it does not appear to change the length? I really appreciate this indicator, it is similar to the standard deviation channel on TOS.
corgalicious
@thabeger, thanks! Have you tried adjusting period settings at the bottom of the settings pane? You might need to scroll down, depending on your display height.

There's a section called SMART PERIOD FINE-TUNING that could help with this. You can assign custom day ranges for 1m, 3m/5m and 10m intervals; everything else is either weeks or bars.

So if you wanted to see 5 days, you could map the 3/5m to 5 days. Just play around with the settings, see what makes most sense to you. :)

(re: TOS — they are similar indeed, but this is actually the StdErr one. StDev on TOS is not giving you the correct visualization for the method it uses)
더보기