OPEN-SOURCE SCRIPT

Regression Curve with Normalized Angle

Aktualisiert
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.
Versionshinweise
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.
Versionshinweise
The default lookback period has been changed to 34.
Versionshinweise
  • 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
Versionshinweise
Unlocked the curve out styles to allow for additional customization.
OscillatorsTrend Analysis

Open-source Skript

Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun das Script auch andere Trader verstehen und prüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Möchten Sie dieses Skript auf einem Chart verwenden?

Haftungsausschluss