OPEN-SOURCE SCRIPT

Probability Cone

142
█ Overview:
Probability Cone is based on the Expected Move. While Expected Move only shows the historical value band on every bar, probability panel extend the period in the future and plot a cone or curve shape of the probable range. It plots the range from bar 1 all the way to bar 31.

In this model, we assume asset price follows a log-normal distribution and the log return follows a normal distribution.
Note: Normal distribution is just an assumption; it's not the real distribution of return.


The area of probability range is based on an inverse normal cumulative distribution function. The inverse cumulative distribution gives the range of price for given input probability. People can adjust the range by adjusting the standard deviation in the settings. The probability of the entered standard deviation will be shown at the edges of the probability cone.

Snapshot

The shown 68% and 95% probabilities correspond to the full range between the two blue lines of the cone (68%) and the two purple lines of the cone (95%). The probabilities suggest the % of outcomes or data that are expected to lie within this range. It does not suggest the probability of reaching those price levels.

Note: All these probabilities are based on the normal distribution assumption for returns. It's the estimated probability, not the actual probability.

█ Volatility Models :

Sample SD: traditional sample standard deviation, most commonly used, use (n-1) period to adjust the bias

Parkinson: Uses High/ Low to estimate volatility, assumes continuous no gap, zero mean no drift, 5 times more efficient than Close to Close

Garman Klass: Uses OHLC volatility, zero drift, no jumps, about 7 times more efficient

Yangzhang Garman Klass Extension: Added jump calculation in Garman Klass, has the same value as Garman Klass on markets with no gaps.
about 8 x efficient

Rogers: Uses OHLC, Assume non-zero mean volatility, handles drift, does not handle jump 8 x efficient.

EWMA: Exponentially Weighted Volatility. Weight recently volatility more, more reactive volatility better in taking account of volatility autocorrelation and cluster.

YangZhang: Uses OHLC, combines Rogers and Garmand Klass, handles both drift and jump, 14 times efficient, alpha is the constant to weight rogers volatility to minimize variance.

Median absolute deviation: It's a more direct way of measuring volatility. It measures volatility without using Standard deviation. The MAD used here is adjusted to be an unbiased estimator.

You can learn more about each of the volatility models in out Historical Volatility Estimators indicator.

█ How to use

Volatility Period is the sample size for variance estimation. A longer period makes the estimation range more stable less reactive to recent price. Distribution is more significant on larger sample size. A short period makes the range more responsive to recent price. Might be better for high volatility clusters.

People usually assume the mean of returns to be zero. To be more accurate, we can consider the drift in price from calculating the geometric mean of returns. Drift happens in the long run, so short lookback periods are not recommended.
The shape of the cone will be skewed and have a directional bias when the length of mean is short. It might be more adaptive to the current price or trend, but more accurate estimation should use a longer period for the mean.
Snapshot

Using a short look back for mean will make the cone having a directional bias.
Snapshot

When we are estimating the future range for time > 1, we typically assume constant volatility and the returns to be independent and identically distributed. We scale the volatility in term of time to get future range. However, when there's autocorrelation in returns( when returns are not independent), the assumption fails to take account of this effect. Volatility scaled with autocorrelation is required when returns are not iid. We use an AR(1) model to scale the first-order autocorrelation to adjust the effect. Returns typically don't have significant autocorrelation. Adjustment for autocorrelation is not usually needed. A long length is recommended in Autocorrelation calculation.
Note: The significance of autocorrelation can be checked on an ACF indicator.
ACF
Snapshot

Time back settings shift the estimation period back by the input number. It's the origin of when the probability cone start to estimation it's range.
E.g., When time back = 5, the probability cone start its prediction interval estimation from 5 bars ago. So for time back = 5 , it estimates the probability range from 5 bars ago to X number of bars in the future, specified by the Forecast Period (max 1000).
Snapshot


█ Warnings:
People should not blindly trust the probability. They should be aware of the risk evolves by using the normal distribution assumption. The real return has skewness and high kurtosis. While skewness is not very significant, the high kurtosis should be noticed. The Real returns have much fatter tails than the normal distribution, which also makes the peak higher. This property makes the tail ranges such as range more than 2SD highly underestimate the actual range and the body such as 1 SD slightly overestimate the actual range. For ranges more than 2SD, people shouldn't trust them. They should beware of extreme events in the tails.
The uncertainty in future bars makes the range wider. The overestimate effect of the body is partly neutralized when it's extended to future bars. We encourage people who use this indicator to further investigate the Historical Volatility Estimators, Fast Autocorrelation Estimator, Expected Move and especially the Linear Moments Indicator.


The probability is only for the closing price, not wicks. It only estimates the probability of the price closing at this level, not in between.


Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.