OPEN-SOURCE SCRIPT
업데이트됨

SwiftEdge GEX

484
SwiftEdge GEX estimates where options dealers are likely to hold gamma, and how that positioning shifts through the day, on any chart. It uses only data TradingView already has: the chart's price and volume, a volatility index or realised volatility, and the options expiry calendar. There are no external feeds, no imported tables and no manual updates.

WHAT IT SHOWS
- GEX heatmap over time: one line per strike near price. The colour shows the sign (amber = positive gamma, violet = negative gamma). Brightness and line width show relative strength, so the strongest strikes stand out. The lines change bar by bar as positions build up, roll off at expiry and as time to expiry shrinks.
- Call wall and put wall over time: the strike with the most call gamma and the strike with the most put gamma, overall and for expiries within 24 hours.
- Gamma flip: the nearest price where estimated total dealer gamma changes sign.
- Dealer hedge desk (right side): a wedge showing how strongly dealers would have to buy (below price) or sell (above price) to stay hedged if price moved to each level. A number column shows "price BUY/SELL strength" on a 0-100 scale (100 = the largest value on screen). Markers show -1 % / +1 % and the turning points where dealers switch from dampening to amplifying moves. The desk follows your zoom: it covers the visible price range and sits at the right edge of the screen.
- Regime card: whether dealers are estimated to dampen moves (long gamma) or amplify them (short gamma), the turning points, the next expiry and the volatility used.

HOW IT WORKS
Option open interest per strike is not available in Pine Script, so the script simulates it:
1. Expiry calendar. Crypto charts use a Deribit-style calendar at 08:00 UTC (daily, Friday weekly, last-Friday monthly, quarterly). SPX, NDX, SPY, QQQ, IWM and their futures and CFDs use 20:00 UTC with daily expiries. Other symbols use Friday weeklies, third-Friday monthlies and quarterlies. Each expiry is listed a fixed time before it expires (daily 4 days, weekly 35 days, monthly 100 days, quarterly 370 days) and is removed when it expires.
2. Position build-up. Every simulation step (30 minutes by default), new positions are opened in every listed expiry around the price that traded, weighted by relative volume. Calls are opened above that price and puts below it. Older positions are closed gradually, with a separate half-life per expiry type. Round strikes collect more open interest.
3. Gamma. For each strike, GEX = sum over expiries of (call OI - put OI) x Black-Scholes gamma(price, strike, volatility, time to expiry) x price^2 x 1 %. Volatility comes from a volatility index when one exists (DVOL, ETHDVOL, VIX, VXN, RVX, VXD, GVZ, VXSLV, OVX, VXAPL, VXAZN, VXGOG). Otherwise it uses 20-day realised volatility, or a manual value.
4. Hedge desk. The hedge needed if price moves from the current price to level P is minus the integral of total gamma between the two prices. It is shown relative to the largest value on screen.
5. Warm-up. When the simulation starts (the last N days, 14 by default), 120 days of daily closes and volumes are folded in first, so long-dated expiries already carry history.

Sign convention: dealers are assumed long calls and short puts. This is a common simplifying assumption, not measured positioning.

WHAT IS ORIGINAL
Most GEX tools need an external options feed, or show static levels typed in by hand. This script builds an evolving open-interest book per expiry and strike from chart data alone. It applies a live expiry calendar so levels appear, strengthen into expiry and disappear after it. It turns the result into a heatmap over time, walls over time and a zoom-aware dealer hedge desk.

HOW TO USE IT
- Treat bright bands as levels where dealer hedging may be concentrated. In positive gamma (dealers dampen), price often gravitates toward strong strikes. Below the flip or past a turning point, dealer hedging can add to the move instead.
- Watch bands strengthen into an expiry and disappear after it. The walls within 24 hours matter most on expiry day.
- Use the desk to see on which side of price hedging pressure is larger, and where it changes sign.
- Settings: Options market (calendar), Volatility source, simulation length and step, Round-strike emphasis (lower values show more and closer zones), heatmap colours, contrast and line width. Every desk element can be switched on or off, and the desk can follow the zoom or use a fixed range.

LIMITATIONS
- This is a model estimate, not real option data. Real open interest depends on trades the chart cannot see, so individual levels can differ from actual positioning.
- Dealer positioning is assumed, not measured.
- Strengths are relative. The script does not show amounts in coins, shares or dollars.
- The simulation starts N days before the moment the chart is loaded, so the oldest part of the heatmap can change when the chart is reloaded. Historical bars are not a record of what the script showed in real time.
- Symbols without volume use equal weights for every step.
- The desk recalculates when you zoom or scroll.
- It is most meaningful on assets with active listed options (major crypto, US indices, ETFs and large caps).

This script is for education and analysis only and is not financial advice.
릴리즈 노트
pdate: simulated liquidity and smoother visuals
- New: Liquidity heatmap (simulated). Resting bids (blue, below price) and asks (red, above price) are drawn as thin bands across the visible chart. The order-book shape behind it was learned from recorded crypto order books (distance from price and round levels). A profile to the right of the last bar shows liquidity at the current price.
- Liquidity level spacing now follows your zoom, and only the visible price range is drawn.
- GEX heatmap: strength is easier to read. Weak strikes are darker, strong strikes are brighter and get an extra thick line. Lines stay on their strike instead of breaking when price crosses a strike.
- Call and put walls no longer jump back and forth between two similar strikes, and they no longer draw vertical connecting lines.
- Dealer hedge desk redesigned: a framed panel with a number column, leader lines to the wedge, a header and a footer. It follows the zoom and the visible price range.
- The regime card is now bottom left by default, so it does not cover the desk.
- New settings for liquidity, heatmap contrast, line width and desk text size.
릴리즈 노트
- Liquidity map: stronger contrast. Big walls are bright and thicker, ordinary levels are dim, scaled from the weakest to the strongest level on screen. New settings: Contrast and "Thicker bands for more liquidity".
릴리즈 노트
- Liquidity map: stronger contrast. Big walls are bright and thicker, ordinary levels are dim, scaled from the weakest to the strongest level on screen. New settings: Contrast and "Thicker bands for more liquidity"..

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.