TradingView
altustro
1. Okt. 2021 15:59

Exponential Regression Channel with novel volatility 

ASML Holding N.V. - New York Registry SharesNASDAQ

Beschreibung

This code is a modified version of the built-in "linear regression" script of Tradingviews which can be plotted correctly on logarithmic charts
The log reg code of Forza was adjusted by altustro to generate an exponential regression (or a correct linear regression on the log scale, this is equivalent).
The standard deviation in the log scale is a better volatility measure which we call novola, and which defines the trend channel displayed in addition to the main indicator.
The exponential regression slope and channel also defines the typical holding time of the stock and the SL/TP boundaries, which are calculated and displayed at the last bar.

The display works both in log and regular scale. But only in the log scale it can be compared to the linear extension, which can also be plotted when activated in the properties.
The underlying exponential fit can not be displayed in regular scale as only lines can be plotted by TV. But with the related script Exponental Regression https://de.tradingview.com/script/mN59QMwJ/ also the exponential regression can be exactly displayed using a workaround.


Versionshinweise

updated to new pine version

added alerts for crossover upper bound UB and crossover UB/2
and crossing ERC
and crossunder lower bound LB and crossunder LB/2 and crossover LB/2

Versionshinweise

added 10 Day performance (or 10 time units to be precise)

Versionshinweise

fix: old lines and labels are now removed - helpful for shorter time units
Kommentare
CarelB
Good afternoon, kindly assist. First of all, brilliant script! I have been receiving: Study Errors - Objects using xloc.bar_index cannot be drawn further than 500 bars into the future. How do I fix this Study Error. I run the script on the 1m time frame. Thank you and I am looking forward in advance to your feedback.
abstract_guy
I like this a lot! Thank you :) I noticed there is one issue, when a bar updates, the green text and triangle is updated but the old one is not removed.
altustro
@abstract_guy, will try to fix it.
altustro
@abstract_guy, shoudl be fixed, please test new version
abstract_guy
@altustro, Amazing! It looks even better now! Thank you
Pratik_4Clover
Interesting idea!
Mehr