OPEN-SOURCE SCRIPT

IV vs RV Volatility Cones

211
What it does

It draws two cones around the same anchor price. One is built from implied volatility, read from India VIX. The other is built from realized volatility, measured on weekly bars of the chart symbol. Both are scaled to the same horizon and drawn with the same geometry, so their widths are directly comparable.

Where the implied cone is wider than the realized cone, the option market was charging for more movement than the index actually delivered. Where it is narrower, the index outran what options were priced for. That gap is the variance risk premium, and it is the whole point of the indicator.

Two cones, two jobs

The historical cone is anchored to a weekly close one horizon in the past, so the whole four-week journey sits inside it and you can see how it resolved. Price finishing outside the realized cone means the index moved further than its own recent volatility said it usually does. Price finishing outside the implied cone means it moved further than options had paid for.

The forward cone starts at the current bar and projects one horizon ahead, using the latest confirmed weekly volatility reading. It is a distribution, not a forecast of direction.

How it is calculated

Implied leg. India VIX is an annualised implied volatility quoted in percentage points. It is rescaled to the horizon by the square root of the horizon over 52.

Realized leg. Weekly log returns are measured over the lookback, then scaled to the horizon by the square root of the number of weeks. Three estimators:

Yang-Zhang, the default. It combines the weekend-gap variance, the open-to-close variance and the Rogers-Satchell range term, weighted by the standard k factor. It uses the whole weekly bar and is the most efficient and most drift-independent of the three.
Std Dev. Sample standard deviation of weekly close-to-close log returns. Simple, and blind to everything inside the week.
ATR%. Weekly Average True Range as a fraction of price, times a user-set factor. Range-aware, but the factor is a convention rather than a derivation.
Both cones use the same geometry, lognormal by default, so a difference in width is a difference in volatility and nothing else.

Reading the panel

The readout gives the one-sigma figure for each leg in percent, the resulting price cone for each, and the ratio of the two. A verdict line calls the ratio rich, fair or cheap against thresholds you set. Rich means implied is running above realized. That is the normal state for an index, so the useful signal is the size of the gap and its direction of travel, not its sign.

Timeframes

All volatility maths runs in the weekly context, so the values are identical on a 15-minute chart and a weekly chart. Use any timeframe up to Weekly. Above Weekly the indicator disables itself and says so, because a weekly request from a monthly chart returns partial bars.

Alerts

Four are provided: implied crossing above the rich threshold, implied crossing below the cheap threshold, and price closing outside the realized cone in either direction.

Limitations, stated plainly

India VIX measures implied volatility on NIFTY 50. Point the implied source at something else and you are comparing one instrument's implied volatility against another's realized volatility, which means nothing. The input exists so you can pair a different index with its own volatility index, not so you can run this on any symbol.
One sigma is a description of a distribution, not a boundary. Roughly one period in three should finish outside a well-calibrated one-sigma cone. Bands being broken is expected behaviour, not a signal.
Square-root-of-time scaling assumes weekly returns are independent. Real index returns cluster in volatility, so the scaling understates the tails during a stress regime and overstates them coming out of one.
The implied leg uses a single at-the-money-ish volatility number and ignores skew, so it will understate downside and overstate upside relative to what the option surface actually prices.
Realized volatility is backward-looking by construction. It tells you what just happened, not what is about to.
This plots volatility. It produces no directional signal, no entries and no exits.
Not financial advice. For education and research only.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.