Snapshot and Historical Comparison

Implied vs Historical Volatility Divergence Detector

Compare a current returned IV sample with past daily-return volatility. Inspect the expiry, sample coverage and timing before interpreting the gap.

Analyze Volatility Divergence

Read the sample before the gap

Enter a supported stock or ETF ticker, a lookback in trading observations and an optional expiry date. The query requests strikes within 10% of the reference price with a 250-contract cap. Without a date, the earliest returned expiry is used; this is not a complete chain or a guaranteed at-the-money volatility benchmark.

Historical volatility

HV uses sample standard deviation of daily log returns multiplied by √252 × 100. A window of 30 needs 31 valid daily closes. The displayed date identifies the last historical observation; price adjustments and source differences can affect the result.

Current implied-volatility sample

Only returned positive finite IV values within 10% of the reference price contribute. OI weights are used only if every included contract has positive available OI; otherwise all included contracts receive equal weights. Missing IV is unavailable, not zero. This average mixes returned calls and puts and does not standardize delta or maturity.

Two different horizons

The HV window looks backward, while the selected options expire on a future date. They are not matched horizons. IV can reflect events, liquidity, risk premia and model assumptions. A high or low IV/HV gap alone does not establish overpricing, underpricing or an options trade.

Chart and threshold

The dashed IV line repeats a single current snapshot value as a reference. Only HV is historical. Spread is in percentage points; relative gap is (IV − HV) / HV × 100. Zero HV makes that relative measure unavailable. Changing inputs clears the previous result.

Sources

Frequently Asked Questions

What does this comparison measure?

It compares a current returned option IV sample with backward-looking daily-close volatility. IV is a model input inferred from option prices; HV summarizes past returns. Different horizons, events and risk premia can explain a gap without proving mispricing.

How is HV calculated?

The sample standard deviation of the selected number of daily log returns is multiplied by the square root of 252 and by 100. The window counts trading observations, not calendar days. Missing or invalid prices prevent a valid comparison.

How is IV selected?

The request is limited to strikes within 10% of the reference price and at most 250 returned contracts. The earliest returned expiry is used unless you enter a specific date. Only positive finite IV values contribute. Positive available OI for every included contract enables OI weighting; otherwise the entire sample uses equal weights.

Is the flat IV line historical IV?

No. It is the one current snapshot value repeated only as a reference against the HV history. No historical IV series is fetched. The options expiry and HV lookback are not automatically matched.

Does a gap recommend buying or selling options?

No. The threshold describes (IV − HV) / HV, not expected profit or fair value. Zero HV makes the relative comparison unavailable. Assess term, liquidity, events, model assumptions and risk independently.

Explore Separate Pine Script Coding Tools

Pineify can draft indicators and strategies for TradingView. This page’s option snapshot is not automatically available inside Pine; review data access, code and test assumptions separately.