OPEN-SOURCE SCRIPT
Diupdate GEX Levels - Dealer Gamma Exposure

GEX DAILY LEVELS — Dealer Gamma Exposure Levels
This indicator plots dealer gamma exposure (GEX) levels as horizontal lines, computed from index option chain data and supplied via a compact text string. It is designed for NQ/NDX but works with any instrument given matching data.
█ METHODOLOGY
The levels follow the standard "naive" dealer positioning convention (dealers long calls, short puts). Per-strike net GEX = gamma × open interest × contract multiplier × spot² × 1%, summed with calls positive and puts negative.
- Call Wall / Put Wall — strikes holding the maximum positive / most negative net GEX across expiries. Dealer hedging around these strikes dampens moves toward them in positive gamma (pinning) and defines major resistance/support.
- 0DTE Walls — the same computation restricted to the current session's expiry, isolating the most reactive intraday hedging flows.
- Gamma Flip — the spot level where aggregate dealer gamma changes sign, obtained by recomputing Black-Scholes gamma across a grid of hypothetical spot prices. Above it, hedging is mean-reverting; below it, hedging amplifies moves.
- Expected Move — the at-the-money straddle price for the nearest expiry: the move the options market is pricing for the day. Fractional bands (e.g. ±50%, ±150% of the straddle) are included because the straddle approximates 0.8 standard deviations, giving each band a defined statistical meaning.
- 1D Min/Max — the one-day range implied by annualized ATM volatility (IV/√252), a complementary volatility-based estimate.
- Max Pain — the strike minimizing total option holder payout at the nearest expiry.
- G+/G− — remaining top strikes ranked by absolute net GEX.
█ WHY A TEXT STRING INPUT
Open interest is static intraday, so gamma levels are constant for the session. Injecting them as data rather than recomputing on chart makes the indicator repaint-free, lookahead-free and provider-agnostic: any gamma data source, or your own option-chain computation, can feed it.
Format: price,label,kind;price,label,kind;...
Kind codes: res, sup (walls) · res0, sup0 (0DTE walls) · flip · emh, eml (expected move) · emb (fractional bands) · ivh, ivl (1D range) · mpain · gpos, gneg
Example: 21100.0,Call Wall,res;20950.5,Gamma Flip,flip;20800.0,Put Wall,sup
█ FEATURES
- Per-family styling: visibility, color, width (1–5), line style for each level type
- Alerts on price crossing walls, 0DTE walls or the gamma flip
- Proximity table showing the nearest level above and below current price with distances
- Label size, offset and price display options
█ LIMITATIONS
Levels are a pre-session snapshot; walls do not move intraday since open interest is settled overnight. The gamma flip may legitimately be absent in strongly positive gamma regimes. Educational tool; nothing here is financial advice.
This indicator plots dealer gamma exposure (GEX) levels as horizontal lines, computed from index option chain data and supplied via a compact text string. It is designed for NQ/NDX but works with any instrument given matching data.
█ METHODOLOGY
The levels follow the standard "naive" dealer positioning convention (dealers long calls, short puts). Per-strike net GEX = gamma × open interest × contract multiplier × spot² × 1%, summed with calls positive and puts negative.
- Call Wall / Put Wall — strikes holding the maximum positive / most negative net GEX across expiries. Dealer hedging around these strikes dampens moves toward them in positive gamma (pinning) and defines major resistance/support.
- 0DTE Walls — the same computation restricted to the current session's expiry, isolating the most reactive intraday hedging flows.
- Gamma Flip — the spot level where aggregate dealer gamma changes sign, obtained by recomputing Black-Scholes gamma across a grid of hypothetical spot prices. Above it, hedging is mean-reverting; below it, hedging amplifies moves.
- Expected Move — the at-the-money straddle price for the nearest expiry: the move the options market is pricing for the day. Fractional bands (e.g. ±50%, ±150% of the straddle) are included because the straddle approximates 0.8 standard deviations, giving each band a defined statistical meaning.
- 1D Min/Max — the one-day range implied by annualized ATM volatility (IV/√252), a complementary volatility-based estimate.
- Max Pain — the strike minimizing total option holder payout at the nearest expiry.
- G+/G− — remaining top strikes ranked by absolute net GEX.
█ WHY A TEXT STRING INPUT
Open interest is static intraday, so gamma levels are constant for the session. Injecting them as data rather than recomputing on chart makes the indicator repaint-free, lookahead-free and provider-agnostic: any gamma data source, or your own option-chain computation, can feed it.
Format: price,label,kind;price,label,kind;...
Kind codes: res, sup (walls) · res0, sup0 (0DTE walls) · flip · emh, eml (expected move) · emb (fractional bands) · ivh, ivl (1D range) · mpain · gpos, gneg
Example: 21100.0,Call Wall,res;20950.5,Gamma Flip,flip;20800.0,Put Wall,sup
█ FEATURES
- Per-family styling: visibility, color, width (1–5), line style for each level type
- Alerts on price crossing walls, 0DTE walls or the gamma flip
- Proximity table showing the nearest level above and below current price with distances
- Label size, offset and price display options
█ LIMITATIONS
Levels are a pre-session snapshot; walls do not move intraday since open interest is settled overnight. The gamma flip may legitimately be absent in strongly positive gamma regimes. Educational tool; nothing here is financial advice.
Catatan Rilis
UPDATE — Multi-market support: NQ · ES · SPX- Three separate paste zones in the settings (NQ, ES, SPX), so each market keeps its own levels string and nothing can get mixed up.
- New "Market" selector, defaulting to Auto: the indicator reads the chart symbol and applies the matching levels automatically (NQ/MNQ/NDX/US100 → NQ · ES/MES/US500 → ES · SPX/SP500 → SPX). Manual override available for unusual tickers.
- The proximity table now displays the active market next to the nearest levels, confirming at a glance which set is applied.
- ES and SPX levels are derived from the SPX option chain (ES via the futures/index basis, SPX at index scale); NQ from the NDX chain, unchanged.
Migration: existing NQ strings keep working — paste them into the "NQ — levels string" zone. Settings from previous versions are otherwise unchanged.
Catatan Rilis
UPDATE — ATR open grid, HGEX level, family master toggles- The Daily Open grid is now volatility-scaled: levels sit at ±0.5 to ±3.0 × ATR(14, daily) from the session open instead of fixed percentages, so distances adapt to the current volatility regime. Labels read "+0.5 ATR", "-1 ATR", etc. (percent labels appear only as a fallback when ATR data is unavailable).
- New HGEX level: the strike carrying the largest absolute net gamma — the session's dominant hedging magnet. Only plotted when distinct from the Call/Put Wall, with its own styling family.
- Three family master switches at the top of the settings — GEX (walls, 0DTE, flip, HGEX, Max Pain, G±), EM · 1D, and Open — toggle whole level families in one click. Per-level settings still apply within an enabled family.
Migration: strings from previous versions keep working; regenerate today's string to get the ATR-scaled grid and HGEX.
Catatan Rilis
Chart updateSkrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
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.