OPEN-SOURCE SCRIPT
Diupdate

Options Positioning Oscillator

271
Options Positioning Oscillator

What it does

The Options Positioning Oscillator is a single bounded line, scaled in standard-deviation (σ) units, that reads where derivatives positioning is leaning — risk-on (bullish) versus risk-off / hedged (bearish).

Most oscillators read price (RSI, Stochastic, MACD, etc.). This one deliberately does not. It reads the implied-volatility and futures-basis structure that sits underneath price, because hedging and positioning leave their footprint in the volatility surface and the cash-and-carry basis before they fully show up in price momentum. The output is one easy-to-read line with σ-banded extremes, so you can see at a glance whether positioning is neutral, leaning, or stretched.

Why these components are combined (mashup rationale)

This is not a bundle of unrelated indicators stacked for the sake of it. The three core legs are complementary, research-documented measurements of the same underlying quantity — the price of variance risk and the market's appetite for risk:


Implied-Volatility Rank — the level of implied vol within its own range (where fear sits historically).
Volatility Term-Structure — implied vol versus its own trend (the slope: calm/contango vs stressed/backwardation).
Futures Basis — the cash-and-carry premium or discount (demand and carry vs hedging pressure).


Each leg, on its own, is a noisy proxy for risk appetite. The academic literature shows each carries genuine information: implied volatility systematically exceeds subsequent realized volatility, producing a variance risk premium (Bakshi & Kapadia 2003; Carr & Wu 2009), and the shape/slope of the volatility term structure carries information about the price of variance risk that predicts volatility-asset returns incrementally to other proxies (Johnson 2017). Combining several noisy-but-informative proxies of one latent variable, on a common standardized scale, denoises any single proxy — a textbook signal-combination, which is exactly why the mashup is justified rather than arbitrary.

Two optional legs — Put-Call Ratio and Option Skew — extend the read for users who can supply that data as an external series. They are off by default because TradingView cannot natively pull live option-chain data; turning them on without a real source would feed price in their place, which would be wrong. The composite automatically re-balances around whatever legs are active.

How the components work together

Every leg is converted to a z-score on its native timeframe so they share one scale (the volatility legs are measured on a stable Daily timeframe by default, so "IV-rank" means the same thing whether you run a 5-minute or daily chart). The legs are sign-aligned so that up = bullish lean in every case:


high implied-vol level → bearish (subtracted)
steep/stressed term slope → bearish (subtracted)
premium futures basis → bullish (added)


They are then combined as a weighted average and lightly smoothed. The result is one line where positive = crowd leaning bullish/risk-on, negative = leaning bearish/hedged, and the dotted Extreme bands flag stretched positioning prone to mean-reversion.

How to use it


Read the level, not only the crosses. Above the +Lean band = bullish lean; below the −Lean band = bearish/hedged lean; beyond the dotted Extreme bands = stretched.
Turns out of an extreme (the triangles) are the actionable events — positioning unwinding from a stretched state.
Divergences (circles) warn when price and positioning disagree — e.g. price makes a higher high while positioning makes a lower high.
Read the EDGE row. The dashboard runs a live forward-return harness: for each turn it checks whether a favourable move (≥ k×ATR within the horizon) actually occurred, and compares that Hit % against the unconditional Base %. EDGE = Hit − Base is the only honest measure of whether the signal is doing anything on your instrument. If EDGE is near zero, the signal is not adding information on that market/timeframe — and the script tells you so.


Why it is original

It is not a re-skinned price oscillator. It is an options/volatility-native positioning gauge that (a) fuses the implied-vol level, term-structure slope, and futures basis into one standardized composite, (b) measures the volatility legs on a stable higher timeframe so the read is timeframe-consistent, and (c) ships with a built-in forward-return calibration harness that reports its own live edge instead of asking you to trust it. I am not aware of a published TradingView oscillator that combines these specific volatility-structure components with self-calibration.

Settings guide


01 · Data Sources — Cash, Futures and Implied-Vol-Index symbols (default NIFTY / NSE; change for any market), the timeframe for the volatility legs (default Daily), and a universal price source.
02 · Engine — IV-rank lookback, term mean length, normalization window, output smoothing.
03 · Component Weights — weight each leg; set a leg to 0 to drop it. Optional PCR / Skew legs (off by default; require external data).
04 · Calibration — horizon, favourable-move threshold (×ATR), base-rate window.
05 · Bands — Lean and Extreme σ bands; divergence pivot.
06 · Display & Theme — visual style (gradient area + glow / histogram / line), background regime tint, dashboard, colors.


Non-repaint

The volatility legs are requested with lookahead_off and settle on their bar's close — there is no future leak. Higher-timeframe values develop through the forming bar and confirm at its close, which is standard, intended behaviour.

Concept credit


Variance risk premium and its predictive content — Bakshi & Kapadia (2003); Carr & Wu (2009); Bollerslev, Tauchen & Zhou (2009).
Volatility term-structure slope and return predictability — Johnson, Risk Premia and the VIX Term Structure (2017).
Cash-and-carry futures basis — standard cost-of-carry theory.
Implied-volatility rank / percentile — established options-desk practice.


Disclaimer

For research and education only. This script is not financial advice, not a recommendation, and not a guarantee of future results. All statistics shown are in-sample, close-to-close, and exclude costs and slippage — a study aid, not a backtest. Do your own research and manage your own risk.
Catatan Rilis
Options Positioning Oscillator (short name: Options Positioning)

New in this update — leg agreement. The composite blends several standardized positioning legs (implied-vol level, volatility term-structure, futures basis, and optional put-call / skew legs). The dashboard now shows how many of those legs agree with the composite's direction (e.g. 3/3), turning the multi-leg blend into a readable confluence gauge: a lean backed by all legs is sturdier than one driven by a single noisy proxy.


New dashboard rows: Leg agreement, Edge floor.
New exports: EXP_Bias, EXP_IVrank, EXP_Term, EXP_Basis, EXP_LegAgree, EXP_Edge, EXP_EdgeLB, EXP_RunsZ.

Honest note: a descriptive positioning gauge, not a directional guarantee. Legs you cannot source can be weighted to zero; the composite re-balances.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.