OPEN-SOURCE SCRIPT

Regression Curve with Normalized Angle

cmthoman의
업데이트됨
Regression Curve with Normalized Angle plots the Linear Regression Curve and the Pearson correlation coefficient to allow a visualized direct comparison of the two over a user defined lookback period. The Pearson correlation coefficient can be used to identify trend without the need to chart the Linear Regression line. As seen in the Crude Chart, Linear Regression angle alone cannot always be used to determine trend. Included are Long and Short threshold lines that can be used to define at what angle a Long or Short trend begins.
릴리즈 노트
User Experience Updates:

Since some traders have shown interest in this, I'm creating an update that improves readability. Below is also a better description of my interpretation for using the indicator for trend analysis.

  • Color coded the Pearson Correlation Line
  • Changed the Regression Curve to a histogram
  • Changed the color of the top and bottom dashed lines of the trend thresholds
  • Code cleanup


My interpretation on trend direction and strength:

The red and green line is Pearson's Correlation Coefficient for the instrument price over time as converted to an angle. It will normalize between 45 and -45 degrees. If it is above 38 or below -38 the trend is considered strong (long or short).

The first time this line crosses into the 38 to 45 degree range the color will change to green for uptrends. The same is true between -38 and -45 degrees for downtrends, the color now changes to red. When the line exits one of these ranges the color will reverse giving you an indication that trend strength (correlation) is weakening and a potential price reversal is being forecasted.

The histogram shows the linear regression curve. Combined with the threshold markers, it provides an at a glance picture of how the trend direction (long, short or none). The correlation line can be used to help confirm the trend direction and strength as the linear regression curve changes.
릴리즈 노트
The default lookback period has been changed to 34.
릴리즈 노트
  • Added parameter options to customize thresholds
  • Added strong long and short correlation zone fills to more clearly depict when the correlation is high
  • Added additional color customization options
  • Rounded the outputs to whole numbers to avoid discrepancies with the 'Precision' style settings
릴리즈 노트
Unlocked the curve out styles to allow for additional customization.
OscillatorsTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

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

면책사항