OPEN-SOURCE SCRIPT
מעודכן Sphinx Gamma Terrain

Sphinx Gamma Terrain renders options dealer-gamma positioning - gamma flip
levels and call/put walls across multiple expiries - as a structural map on
your chart. It is a context layer that shows where the gamma structure sits
and which regime price is trading inside. It does not generate buy/sell
signals, predictions, or automated trades.
Why it is original
Pine Script cannot fetch external options data such as dealer gamma exposure,
flip levels, or wall strikes. This tool solves that by taking a compact text
export of gamma levels and turning it into on-chart terrain. Two things make
it distinct from a plain level-drawing script:
1. A symbol-aware parser reads a full multi-instrument, multi-expiry gamma
export in a single paste and locks onto the current chart's instrument
(an ES/MES chart pulls the ES block), so a stacked NQ or GC block cannot
overwrite it.
2. A graduated, count-based regime model. Instead of a flat two-colour zone,
the shading deepens according to how many flip levels price sits above or
below, split at the median flip - so the depth of the positive- or
negative-gamma regime is readable as tone rather than a single on/off band.
It is provider-agnostic: it works with any gamma/GEX source. Either paste a
string in the documented format, or type the levels in manually. Nothing is
hard-wired to one vendor.
The three layers
- Flip ladder: gamma flip levels for near, mid and far expiries. The reactive
near-term flip is dashed; the more stable mid/far flips are dotted and drawn
thicker, because they define the regime frame.
- Regime shading: green (fade) above the flips, where positive gamma tends to
suppress moves and mean-revert; red (trend) below, where negative gamma
tends to amplify. Tone deepens with regime depth, and the green/red split
lands on the median flip so the two never overlap.
- Confluence walls: call and put walls across expiries, clustered so walls
within a tolerance band merge into a single reversal zone. A multi-strike
cluster is drawn as a translucent band spanning its strikes, tagged with the
number of hits - the heavy multi-expiry shelves stand out from lone walls.
How to use it
1. Choose an input mode. Paste string auto-parses an export of the form
SYM.DTE:F<flip>|CW<call walls>|PW<put walls>, with expiries separated by
semicolons. Manual levels lets you type each flip and wall set yourself;
any field left blank is simply not drawn.
2. The tool locks to your chart's instrument and draws that instrument's
flips, regime zones and walls.
3. Read the terrain as a frame, not a trigger: note which regime price is in,
where the nearest flip or wall reversal zone sits, and how the tenors
stack. Combine it with your own timing and execution method.
Inputs
Flips, regime zones and walls each have independent visibility, colour,
opacity and width controls. The regime shading exposes six opacity tiers
(three each direction) so you can tune how strongly depth reads. Wall cluster
tolerance is adjustable - widen it to treat a band of strikes as one reversal
zone, tighten it for per-strike reads. Defaults are tuned for a dark theme and
can be dialled back for live use.
Limitations
- The data is external and static: the tool draws whatever you last pasted or
typed. It does not auto-update - refresh your gamma export when the structure
changes (for example at the open, mid-session, or on a flip crossing).
- It is a positioning and context map, not a signal engine. There are no
alerts, entries, or performance claims, and gamma levels always require
judgement in context.
- Level accuracy depends entirely on your data source.
levels and call/put walls across multiple expiries - as a structural map on
your chart. It is a context layer that shows where the gamma structure sits
and which regime price is trading inside. It does not generate buy/sell
signals, predictions, or automated trades.
Why it is original
Pine Script cannot fetch external options data such as dealer gamma exposure,
flip levels, or wall strikes. This tool solves that by taking a compact text
export of gamma levels and turning it into on-chart terrain. Two things make
it distinct from a plain level-drawing script:
1. A symbol-aware parser reads a full multi-instrument, multi-expiry gamma
export in a single paste and locks onto the current chart's instrument
(an ES/MES chart pulls the ES block), so a stacked NQ or GC block cannot
overwrite it.
2. A graduated, count-based regime model. Instead of a flat two-colour zone,
the shading deepens according to how many flip levels price sits above or
below, split at the median flip - so the depth of the positive- or
negative-gamma regime is readable as tone rather than a single on/off band.
It is provider-agnostic: it works with any gamma/GEX source. Either paste a
string in the documented format, or type the levels in manually. Nothing is
hard-wired to one vendor.
The three layers
- Flip ladder: gamma flip levels for near, mid and far expiries. The reactive
near-term flip is dashed; the more stable mid/far flips are dotted and drawn
thicker, because they define the regime frame.
- Regime shading: green (fade) above the flips, where positive gamma tends to
suppress moves and mean-revert; red (trend) below, where negative gamma
tends to amplify. Tone deepens with regime depth, and the green/red split
lands on the median flip so the two never overlap.
- Confluence walls: call and put walls across expiries, clustered so walls
within a tolerance band merge into a single reversal zone. A multi-strike
cluster is drawn as a translucent band spanning its strikes, tagged with the
number of hits - the heavy multi-expiry shelves stand out from lone walls.
How to use it
1. Choose an input mode. Paste string auto-parses an export of the form
SYM.DTE:F<flip>|CW<call walls>|PW<put walls>, with expiries separated by
semicolons. Manual levels lets you type each flip and wall set yourself;
any field left blank is simply not drawn.
2. The tool locks to your chart's instrument and draws that instrument's
flips, regime zones and walls.
3. Read the terrain as a frame, not a trigger: note which regime price is in,
where the nearest flip or wall reversal zone sits, and how the tenors
stack. Combine it with your own timing and execution method.
Inputs
Flips, regime zones and walls each have independent visibility, colour,
opacity and width controls. The regime shading exposes six opacity tiers
(three each direction) so you can tune how strongly depth reads. Wall cluster
tolerance is adjustable - widen it to treat a band of strikes as one reversal
zone, tighten it for per-strike reads. Defaults are tuned for a dark theme and
can be dialled back for live use.
Limitations
- The data is external and static: the tool draws whatever you last pasted or
typed. It does not auto-update - refresh your gamma export when the structure
changes (for example at the open, mid-session, or on a flip crossing).
- It is a positioning and context map, not a signal engine. There are no
alerts, entries, or performance claims, and gamma levels always require
judgement in context.
- Level accuracy depends entirely on your data source.
הערות שחרור
update title סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.