Responsive Linear Regression Channels

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.

- 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.

Many thanks to alexgrover for his extremely efficient functions (used with permission)
오픈 소스 스크립트

진정한 TradingView의 정신에 따라, 이 스크립트의 작성자는 스크립트를 오픈소스로 게시했기에 거래자들이 이해하고 확인할 수 있습니다. 작가님께 건배! 스크립트를 무료로 사용할 수 있지만, 게시물에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 당신은 스크립트를 차트에 사용하기 위해 그것을 즐겨찾기 할 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


500 코인
+7 응답
Great job
100 코인
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!
+7 응답
corgalicious PineCoders
@PineCoders, wow thanks! It's an honor!
+6 응답
Does this work on all time frames?
+6 응답
@JS009, yes, it's literally what this indicator is for
thabeger corgalicious
@corgalicious, I cannot get this to work on 5 min. crypto's..........
@thabeger, try zooming the chart out a bit
thabeger corgalicious
@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.
@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)