Opening Range Breakout Indicator for ThinkorSwim

Sorry it is late and my notes were mixed lol.. that's what getting old does to ya! I asked Chat GPT to "clean this up" so it is what it is lol... but on review everything is there except notes that there are some manual inputs that need to be placed like what Gamma phase is it in either short gamma or long gamma or transition (1, -1, 0) and other inputs are gamma zones, which are usually gamma high volumes or if using Open Interest high bars strike prices like in Barchart.com Gamma charts. What follows is an explanation of the script and interpretation of the attached chart using this script. This script was developed in reviewing ORB studies and scripts from TOS, TradingView and NinjaTrader.

This is an excellent example — not just of the script working, but of how to think like a professional intraday trader using structure + flow + regime.
I’ll break this down as a training walkthrough so someone else could literally follow this step-by-step.

🧠 1. THE FOUNDATION: WHAT THIS SYSTEM IS DOING

This script combines 5 layers of edge:

1. Gamma (Context)​

  • Tells you: trend vs mean reversion environment
2. Levels (Structure)
  • Reclaim level (640)
  • Fade zones (643–645, 648–650)

3. Timing (Execution)​

  • First touch (FZ1)
  • Trap detection

4. Confirmation (Participation)​

  • VWAP
  • ORB breaks

5. Decision Engine​

  • Score
  • Bias
  • Market state (your new label)

📊 2. WHAT HAPPENED ON THIS CHART (STEP-BY-STEP)​


Let’s walk through this like a replay.

🔴 PHASE 1 — OPEN → INITIAL TREND​

  • Price starts below reclaim (640)
  • Gamma = SHORT (trend mode)
👉 Immediate implication: Sell rallies, not buy dips


🟡 PHASE 2 — FIRST OPPORTUNITY (FZ1 TAGS)​


You see multiple:
  • FZ1 bubbles (yellow)
👉 This is critical:


These are: First touch of resistance inside short gamma

✔ This is your highest probability short entry


What should happen (and did):​

  • Price enters 643–645
  • Momentum slows
  • Sellers step in
  • Price rolls over

👉 This is your A+ setup


🔴 PHASE 3 — TRAP FORMATION (MOST IMPORTANT)​


You see:
  • Multiple TRAP DN labels near 640

What this means:​

  1. Price tries to reclaim 640
  2. Fails
  3. Closes back below
👉 This is: FAILED BREAKOUT → CONTINUATION SIGNAL


Why this matters:​


In short gamma:
  • Dealers sell weakness
  • Failed reclaim = fuel for downside

👉 This is the strongest signal in your system

🔻 PHASE 4 — ORB CONFIRMATION

You see:
  • ORB DN signals

Combined with:
  • Price below VWAP
👉 This confirms: Trend is real, not random


🔥 PHASE 5 — TREND ACCELERATION​


After:
  • FZ1 rejection
  • Trap confirmation
  • ORB break

👉 Market transitions into: STRUCTURED TREND DOWN

You see:
  • Clean lower highs
  • Clean lower lows
  • No reclaim of key levels
⚠️ PHASE 6 — LATE TREND (KEY LESSON)

Now your label shows: LATE TREND / LOW EDGE

This is crucial training insight.

Why?​


Because:
  • Move already extended
  • Far from reclaim (640)
  • No new structure formed
  • Score = weak (-2)
👉 Meaning: The opportunity already happened


🧭 3. HOW A PROFESSIONAL TRADES THIS​


✅ What they DO​

Early:
  • Short FZ1 (643–645)
  • Add on trap near 640
  • Hold through ORB break

Mid-trend:​

  • Trail position
  • Take partial profits

Late trend (your current chart):​

  • STOP initiating new trades
  • Wait for reset

❌ What they DON’T do​

  • Chase breakdown at 633
  • Short randomly because “it’s going down”
  • Ignore “NO TRADE” signal

🧠 4. WHAT EACH COMPONENT TAUGHT YOU​


🔵 Gamma Mode​




Answer: Trend


🟡 Fade Zones​




Answer: 643–645 (FZ1)


🔴 Trap Detection​




Answer: Fake → short


🟢 ORB + VWAP​




Answer: Yes → hold trade


⚠️ Market State Label​




Answer: No → late trend

🔥 5. THE BIG LESSON (MOST IMPORTANT)​


This chart demonstrates:

The edge is NOT in predicting direction
The edge is in timing + location + context


🧠 6. SIMPLE RULESET (FOR TRAINING)​


If someone is learning this system, give them this:


🔴 SHORT GAMMA PLAYBOOK​


Step 1 — Identify regime​

  • Below flip → trend mode

Step 2 — Wait for location​

  • Fade zones (FZ1 / FZ2)

Step 3 — Confirm weakness​

  • Trap signal
  • Rejection

Step 4 — Confirm trend​

  • Below VWAP
  • ORB break

Step 5 — Manage trade​

  • Hold through structure
  • Exit when:
    • Late trend label appears
    • Score weakens

⚠️ 7. WHY THIS SYSTEM WORKS​


Because it aligns:
  • Dealer flows (gamma)
  • Liquidity (levels)
  • Behavior (traps)
  • Participation (VWAP/ORB)

👉 That’s how institutions think


🧭 FINAL SUMMARY​


This chart is a perfect training example of:

✔ Ideal short setup:​

  • FZ1 entry
  • Trap confirmation
  • ORB + VWAP alignment
✔ Ideal hold:
  • Trend continuation

✔ Ideal stop trading:​

  • Late trend label
Code:
# Gamma Edge Execution System
# Developed by antwerks
# 03/29/2026
#=================================


# ================================
# === USER INPUTS ===============
# ================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

input reclaimLevel = 640;
input fadeZone1Low = 643;
input fadeZone1High = 645;
input fadeZone2Low = 648;
input fadeZone2High = 650;

input orbStartTime = 0930;
input orbEndTime   = 1000;

# ================================
# === YESTERDAY LEVELS ===========
# ================================
def yHigh = high(period = "DAY")[1];
def yLow = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

# ================================
# === RECLAIM LEVEL ==============
# ================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

# ================================
# === GAMMA MODE COLORS ==========
# ================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

# ================================
# === FADE ZONES ================
# ================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));

FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));

# ================================
# === FIRST TOUCH DETECTION ======
# ================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

# ================================
# === TRAP DETECTION ============
# ================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;

def wasAbove = aboveReclaim[1];

def rejection = high > reclaimLevel and close < reclaimLevel;
def strongReject = close < open;

def trapShort = wasAbove and rejection and strongReject;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);

# ================================
# === VWAP ======================
# ================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

# ================================
# === ORB (TIME-BASED, FIXED) ====
# ================================

def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbHigh[1]) then high
    else if inORB then Max(high, orbHigh[1])
    else orbHigh[1];

rec orbLow =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbLow[1]) then low
    else if inORB then Min(low, orbLow[1])
    else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_High_Line.SetStyle(Curve.SHORT_DASH);
ORB_High_Line.SetLineWeight(2);

plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;
ORB_Low_Line.SetDefaultColor(Color.RED);
ORB_Low_Line.SetStyle(Curve.SHORT_DASH);
ORB_Low_Line.SetLineWeight(2);

def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

AddChartBubble(breakAboveORB and !breakAboveORB[1], low, "ORB UP", Color.GREEN, no);
AddChartBubble(breakBelowORB and !breakBelowORB[1], high, "ORB DN", Color.RED, yes);
# ================================
# === CONFIRMATION LOGIC ========
# ================================
def trendConfirmedShort = belowVWAP and breakBelowORB;
def trendConfirmedLong = aboveVWAP and breakAboveORB;

# ================================
# === SCORING ===================
# ================================
def avgVol = Average(volume, 20);
def highVol = volume > avgVol * 1.2;

def bull = close > open;
def bear = close < open;

def bullScore =
    (if highVol then 2 else 1) +
    (if bull then 2 else 0);

def bearScore =
    (if highVol then 2 else 1) +
    (if bear then 2 else 0);

def netScore = bullScore - bearScore;

# ================================
# === LABELS ====================
# ================================
AddLabel(yes,
    if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
    else "Gamma: LONG (Mean Reversion)",
    if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
    "Score: " + netScore +
    if netScore >= 4 then " (LONG)"
    else if netScore <= -4 then " (SHORT)"
    else " (NO TRADE)",
    if netScore >= 2 then Color.GREEN
    else if netScore <= -2 then Color.RED
    else Color.GRAY
);

def noTrade = AbsValue(netScore) <= 2;

AddLabel(yes,
    if noTrade then "NO TRADE"
    else "ACTIVE",
    if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
    if trendConfirmedShort then "CONFIRMED SHORT (ORB + VWAP)"
    else if trendConfirmedLong then "CONFIRMED LONG (ORB + VWAP)"
    else "NO CONFIRMATION",
    if trendConfirmedShort then Color.RED
    else if trendConfirmedLong then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    if netScore <= -4 then "Bias: SHORT (Sell Rips)"
    else if netScore >= 4 then "Bias: LONG (Buy Dips)"
    else "Bias: NEUTRAL",
    if netScore <= -4 then Color.RED
    else if netScore >= 4 then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    "Reclaim: " + reclaimLevel +
    " | FZ1: " + fadeZone1Low + "-" + fadeZone1High +
    " | FZ2: " + fadeZone2Low + "-" + fadeZone2High,
    Color.WHITE
);

# ================================
# === MARKET STATE LABEL =========
# ================================

# Distance from reclaim (extension proxy)
def extension = AbsValue(close - reclaimLevel);

# You can tweak this threshold
input extensionThreshold = 5.0;

def isExtended = extension > extensionThreshold;

# State conditions
def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

# Label logic
AddLabel(yes,
    if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
    else if lateTrend then "LATE TREND / LOW TRADING EDGE"
    else if weakEnv then "CHOP / LOW CONVICTION"
    else "TRANSITION",
   
    if strongTrend then Color.GREEN
    else if lateTrend then Color.YELLOW
    else if weakEnv then Color.GRAY
    else Color.DARK_ORANGE
);

# ================================
# === ALERTS ====================
# ================================
Alert(trapShort, "Trap Detected → Short Setup", Alert.BAR, Sound.Bell);
Is this just for SPY? How do you what "reclaim" level to use?
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

I ran it through ChatGPT and created an "improved" version.
I added appropriate ### for you to make it work?

Code:
#Gamma Edge Execution System
#Developed by antwerks (Enhanced Version)
#03/29/2026
#=================================

#================================
#=== USER INPUTS ===============
#================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

input reclaimLevel = 640;
input fadeZone1Low = 643;
input fadeZone1High = 645;
input fadeZone2Low = 648;
input fadeZone2High = 650;

input orbStartTime = 0930;
input orbEndTime = 1000;

input extensionThreshold = 5.0;

#================================
#=== YESTERDAY LEVELS ===========
#================================
def yHigh = high(period = "DAY")[1];
def yLow = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

#================================
#=== RECLAIM LEVEL ==============
#================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

#================================
#=== GAMMA MODE =================

#================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

#================================
#=== FADE ZONES =================
#================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));

FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));


#================================
#=== FIRST TOUCH DETECTION ======
#================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

#================================
#=== TRAP DETECTION (IMPROVED) ==
#================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;

def wasAbove = aboveReclaim[1];
def wasBelow = belowReclaim[1];

#Wick-based rejection
def upperWick = high - Max(open, close);
def lowerWick = Min(open, close) - low;
def body = AbsValue(close - open);

def strongRejectDown = upperWick > body * 1.5 and close < open;
def strongRejectUp = lowerWick > body * 1.5 and close > open;

def rejectionDown = high > reclaimLevel and close < reclaimLevel;
def rejectionUp = low < reclaimLevel and close > reclaimLevel;

def trapShort = wasAbove and rejectionDown and strongRejectDown;
def trapLong = wasBelow and rejectionUp and strongRejectUp;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);
AddChartBubble(trapLong and !trapLong[1], low, "TRAP UP", Color.GREEN, no);

#================================
#=== VWAP =======================
#================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

#================================
#=== ORB ========================
#================================
def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
if newDay then Double.NaN
else if inORB and IsNaN(orbHigh[1]) then high
else if inORB then Max(high, orbHigh[1])
else orbHigh[1];

rec orbLow =
if newDay then Double.NaN
else if inORB and IsNaN(orbLow[1]) then low
else if inORB then Min(low, orbLow[1])
else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;

ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_Low_Line.SetDefaultColor(Color.RED);

#First break only (fixed)
def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

def firstBreakAboveORB = breakAboveORB and !breakAboveORB[1];
def firstBreakBelowORB = breakBelowORB and !breakBelowORB[1];

AddChartBubble(firstBreakAboveORB, low, "ORB UP", Color.GREEN, no);
AddChartBubble(firstBreakBelowORB, high, "ORB DN", Color.RED, yes);

#================================
#=== CONFIRMATION ===============
#================================
def trendConfirmedShort = belowVWAP and firstBreakBelowORB;
def trendConfirmedLong = aboveVWAP and firstBreakAboveORB;

#================================
#=== SCORING (IMPROVED) =========
#================================
def avgVol = Average(volume, 20);
def highVol = volume > avgVol * 1.2;

def bull = close > open;
def bear = close < open;

def bullScore =
(if highVol then 2 else 1) +
(if bull then 2 else 0);

def bearScore =
(if highVol then 2 else 1) +
(if bear then 2 else 0);

#Location factor
def locationScore =
if close > reclaimLevel then 1
else if close < reclaimLevel then -1
else 0;

def netScore = (bullScore - bearScore) + locationScore;

def noTrade = AbsValue(netScore) <= 2;

#================================
#=== MARKET STATE ===============
#================================
def extension = AbsValue(close - reclaimLevel);
def isExtended = extension > extensionThreshold;

def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

#================================
#=== LABELS =====================
#================================
AddLabel(yes,
if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
else "Gamma: LONG (Mean Reversion)",
if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
"Score: " + netScore +
if netScore >= 4 then " (LONG)"
else if netScore <= -4 then " (SHORT)"
else " (NO TRADE)",
if netScore >= 2 then Color.GREEN
else if netScore <= -2 then Color.RED
else Color.GRAY
);

AddLabel(yes,
if noTrade then "NO TRADE" else "ACTIVE",
if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
else if lateTrend then "LATE TREND"
else if weakEnv then "CHOP"
else "TRANSITION",
if strongTrend then Color.GREEN
else if lateTrend then Color.YELLOW
else if weakEnv then Color.GRAY
else Color.DARK_ORANGE
);

#================================
#=== ALERTS =====================
#================================
Alert(trapShort, "Trap Short", Alert.BAR, Sound.Bell);
Alert(trapLong, "Trap Long", Alert.BAR, Sound.Bell);
 
Last edited by a moderator:
I added appropriate ### for you to make it work?

Code:
#Gamma Edge Execution System
#Developed by antwerks (Enhanced Version)
#03/29/2026
#=================================

#================================
#=== USER INPUTS ===============
#================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

input reclaimLevel = 640;
input fadeZone1Low = 643;
input fadeZone1High = 645;
input fadeZone2Low = 648;
input fadeZone2High = 650;

input orbStartTime = 0930;
input orbEndTime = 1000;

input extensionThreshold = 5.0;

#================================
#=== YESTERDAY LEVELS ===========
#================================
def yHigh = high(period = "DAY")[1];
def yLow = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

#================================
#=== RECLAIM LEVEL ==============
#================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

#================================
#=== GAMMA MODE =================

#================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

#================================
#=== FADE ZONES =================
#================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));

FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));


#================================
#=== FIRST TOUCH DETECTION ======
#================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

#================================
#=== TRAP DETECTION (IMPROVED) ==
#================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;

def wasAbove = aboveReclaim[1];
def wasBelow = belowReclaim[1];

#Wick-based rejection
def upperWick = high - Max(open, close);
def lowerWick = Min(open, close) - low;
def body = AbsValue(close - open);

def strongRejectDown = upperWick > body * 1.5 and close < open;
def strongRejectUp = lowerWick > body * 1.5 and close > open;

def rejectionDown = high > reclaimLevel and close < reclaimLevel;
def rejectionUp = low < reclaimLevel and close > reclaimLevel;

def trapShort = wasAbove and rejectionDown and strongRejectDown;
def trapLong = wasBelow and rejectionUp and strongRejectUp;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);
AddChartBubble(trapLong and !trapLong[1], low, "TRAP UP", Color.GREEN, no);

#================================
#=== VWAP =======================
#================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

#================================
#=== ORB ========================
#================================
def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
if newDay then Double.NaN
else if inORB and IsNaN(orbHigh[1]) then high
else if inORB then Max(high, orbHigh[1])
else orbHigh[1];

rec orbLow =
if newDay then Double.NaN
else if inORB and IsNaN(orbLow[1]) then low
else if inORB then Min(low, orbLow[1])
else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;

ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_Low_Line.SetDefaultColor(Color.RED);

#First break only (fixed)
def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

def firstBreakAboveORB = breakAboveORB and !breakAboveORB[1];
def firstBreakBelowORB = breakBelowORB and !breakBelowORB[1];

AddChartBubble(firstBreakAboveORB, low, "ORB UP", Color.GREEN, no);
AddChartBubble(firstBreakBelowORB, high, "ORB DN", Color.RED, yes);

#================================
#=== CONFIRMATION ===============
#================================
def trendConfirmedShort = belowVWAP and firstBreakBelowORB;
def trendConfirmedLong = aboveVWAP and firstBreakAboveORB;

#================================
#=== SCORING (IMPROVED) =========
#================================
def avgVol = Average(volume, 20);
def highVol = volume > avgVol * 1.2;

def bull = close > open;
def bear = close < open;

def bullScore =
(if highVol then 2 else 1) +
(if bull then 2 else 0);

def bearScore =
(if highVol then 2 else 1) +
(if bear then 2 else 0);

#Location factor
def locationScore =
if close > reclaimLevel then 1
else if close < reclaimLevel then -1
else 0;

def netScore = (bullScore - bearScore) + locationScore;

def noTrade = AbsValue(netScore) <= 2;

#================================
#=== MARKET STATE ===============
#================================
def extension = AbsValue(close - reclaimLevel);
def isExtended = extension > extensionThreshold;

def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

#================================
#=== LABELS =====================
#================================
AddLabel(yes,
if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
else "Gamma: LONG (Mean Reversion)",
if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
"Score: " + netScore +
if netScore >= 4 then " (LONG)"
else if netScore <= -4 then " (SHORT)"
else " (NO TRADE)",
if netScore >= 2 then Color.GREEN
else if netScore <= -2 then Color.RED
else Color.GRAY
);

AddLabel(yes,
if noTrade then "NO TRADE" else "ACTIVE",
if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
else if lateTrend then "LATE TREND"
else if weakEnv then "CHOP"
else "TRANSITION",
if strongTrend then Color.GREEN
else if lateTrend then Color.YELLOW
else if weakEnv then Color.GRAY
else Color.DARK_ORANGE
);

#================================
#=== ALERTS =====================
#================================
Alert(trapShort, "Trap Short", Alert.BAR, Sound.Bell);
Alert(trapLong, "Trap Long", Alert.BAR, Sound.Bell);
I don't see how that makes it work for me trading other securities.
 
Sorry it is late and my notes were mixed lol.. that's what getting old does to ya! I asked Chat GPT to "clean this up" so it is what it is lol... but on review everything is there except notes that there are some manual inputs that need to be placed like what Gamma phase is it in either short gamma or long gamma or transition (1, -1, 0) and other inputs are gamma zones, which are usually gamma high volumes or if using Open Interest high bars strike prices like in Barchart.com Gamma charts. What follows is an explanation of the script and interpretation of the attached chart using this script. This script was developed in reviewing ORB studies and scripts from TOS, TradingView and NinjaTrader.

This is an excellent example — not just of the script working, but of how to think like a professional intraday trader using structure + flow + regime.
I’ll break this down as a training walkthrough so someone else could literally follow this step-by-step.

🧠 1. THE FOUNDATION: WHAT THIS SYSTEM IS DOING

This script combines 5 layers of edge:

1. Gamma (Context)​

  • Tells you: trend vs mean reversion environment
2. Levels (Structure)
  • Reclaim level (640)
  • Fade zones (643–645, 648–650)

3. Timing (Execution)​

  • First touch (FZ1)
  • Trap detection

4. Confirmation (Participation)​

  • VWAP
  • ORB breaks

5. Decision Engine​

  • Score
  • Bias
  • Market state (your new label)

📊 2. WHAT HAPPENED ON THIS CHART (STEP-BY-STEP)​


Let’s walk through this like a replay.

🔴 PHASE 1 — OPEN → INITIAL TREND​

  • Price starts below reclaim (640)
  • Gamma = SHORT (trend mode)
👉 Immediate implication: Sell rallies, not buy dips


🟡 PHASE 2 — FIRST OPPORTUNITY (FZ1 TAGS)​


You see multiple:
  • FZ1 bubbles (yellow)
👉 This is critical:


These are: First touch of resistance inside short gamma

✔ This is your highest probability short entry


What should happen (and did):​

  • Price enters 643–645
  • Momentum slows
  • Sellers step in
  • Price rolls over

👉 This is your A+ setup


🔴 PHASE 3 — TRAP FORMATION (MOST IMPORTANT)​


You see:
  • Multiple TRAP DN labels near 640

What this means:​

  1. Price tries to reclaim 640
  2. Fails
  3. Closes back below
👉 This is: FAILED BREAKOUT → CONTINUATION SIGNAL


Why this matters:​


In short gamma:
  • Dealers sell weakness
  • Failed reclaim = fuel for downside

👉 This is the strongest signal in your system

🔻 PHASE 4 — ORB CONFIRMATION

You see:
  • ORB DN signals

Combined with:
  • Price below VWAP
👉 This confirms: Trend is real, not random


🔥 PHASE 5 — TREND ACCELERATION​


After:
  • FZ1 rejection
  • Trap confirmation
  • ORB break

👉 Market transitions into: STRUCTURED TREND DOWN

You see:
  • Clean lower highs
  • Clean lower lows
  • No reclaim of key levels
⚠️ PHASE 6 — LATE TREND (KEY LESSON)

Now your label shows: LATE TREND / LOW EDGE

This is crucial training insight.

Why?​


Because:
  • Move already extended
  • Far from reclaim (640)
  • No new structure formed
  • Score = weak (-2)
👉 Meaning: The opportunity already happened


🧭 3. HOW A PROFESSIONAL TRADES THIS​


✅ What they DO​

Early:
  • Short FZ1 (643–645)
  • Add on trap near 640
  • Hold through ORB break

Mid-trend:​

  • Trail position
  • Take partial profits

Late trend (your current chart):​

  • STOP initiating new trades
  • Wait for reset

❌ What they DON’T do​

  • Chase breakdown at 633
  • Short randomly because “it’s going down”
  • Ignore “NO TRADE” signal

🧠 4. WHAT EACH COMPONENT TAUGHT YOU​


🔵 Gamma Mode​




Answer: Trend


🟡 Fade Zones​




Answer: 643–645 (FZ1)


🔴 Trap Detection​




Answer: Fake → short


🟢 ORB + VWAP​




Answer: Yes → hold trade


⚠️ Market State Label​




Answer: No → late trend

🔥 5. THE BIG LESSON (MOST IMPORTANT)​


This chart demonstrates:

The edge is NOT in predicting direction
The edge is in timing + location + context


🧠 6. SIMPLE RULESET (FOR TRAINING)​


If someone is learning this system, give them this:


🔴 SHORT GAMMA PLAYBOOK​


Step 1 — Identify regime​

  • Below flip → trend mode

Step 2 — Wait for location​

  • Fade zones (FZ1 / FZ2)

Step 3 — Confirm weakness​

  • Trap signal
  • Rejection

Step 4 — Confirm trend​

  • Below VWAP
  • ORB break

Step 5 — Manage trade​

  • Hold through structure
  • Exit when:
    • Late trend label appears
    • Score weakens

⚠️ 7. WHY THIS SYSTEM WORKS​


Because it aligns:
  • Dealer flows (gamma)
  • Liquidity (levels)
  • Behavior (traps)
  • Participation (VWAP/ORB)

👉 That’s how institutions think


🧭 FINAL SUMMARY​


This chart is a perfect training example of:

✔ Ideal short setup:​

  • FZ1 entry
  • Trap confirmation
  • ORB + VWAP alignment
✔ Ideal hold:
  • Trend continuation

✔ Ideal stop trading:​

  • Late trend label
Code:
# Gamma Edge Execution System
# Developed by antwerks
# 03/29/2026
#=================================


# ================================
# === USER INPUTS ===============
# ================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

input reclaimLevel = 640;
input fadeZone1Low = 643;
input fadeZone1High = 645;
input fadeZone2Low = 648;
input fadeZone2High = 650;

input orbStartTime = 0930;
input orbEndTime   = 1000;

# ================================
# === YESTERDAY LEVELS ===========
# ================================
def yHigh = high(period = "DAY")[1];
def yLow = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

# ================================
# === RECLAIM LEVEL ==============
# ================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

# ================================
# === GAMMA MODE COLORS ==========
# ================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

# ================================
# === FADE ZONES ================
# ================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));

FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));

# ================================
# === FIRST TOUCH DETECTION ======
# ================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

# ================================
# === TRAP DETECTION ============
# ================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;

def wasAbove = aboveReclaim[1];

def rejection = high > reclaimLevel and close < reclaimLevel;
def strongReject = close < open;

def trapShort = wasAbove and rejection and strongReject;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);

# ================================
# === VWAP ======================
# ================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

# ================================
# === ORB (TIME-BASED, FIXED) ====
# ================================

def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbHigh[1]) then high
    else if inORB then Max(high, orbHigh[1])
    else orbHigh[1];

rec orbLow =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbLow[1]) then low
    else if inORB then Min(low, orbLow[1])
    else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_High_Line.SetStyle(Curve.SHORT_DASH);
ORB_High_Line.SetLineWeight(2);

plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;
ORB_Low_Line.SetDefaultColor(Color.RED);
ORB_Low_Line.SetStyle(Curve.SHORT_DASH);
ORB_Low_Line.SetLineWeight(2);

def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

AddChartBubble(breakAboveORB and !breakAboveORB[1], low, "ORB UP", Color.GREEN, no);
AddChartBubble(breakBelowORB and !breakBelowORB[1], high, "ORB DN", Color.RED, yes);
# ================================
# === CONFIRMATION LOGIC ========
# ================================
def trendConfirmedShort = belowVWAP and breakBelowORB;
def trendConfirmedLong = aboveVWAP and breakAboveORB;

# ================================
# === SCORING ===================
# ================================
def avgVol = Average(volume, 20);
def highVol = volume > avgVol * 1.2;

def bull = close > open;
def bear = close < open;

def bullScore =
    (if highVol then 2 else 1) +
    (if bull then 2 else 0);

def bearScore =
    (if highVol then 2 else 1) +
    (if bear then 2 else 0);

def netScore = bullScore - bearScore;

# ================================
# === LABELS ====================
# ================================
AddLabel(yes,
    if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
    else "Gamma: LONG (Mean Reversion)",
    if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
    "Score: " + netScore +
    if netScore >= 4 then " (LONG)"
    else if netScore <= -4 then " (SHORT)"
    else " (NO TRADE)",
    if netScore >= 2 then Color.GREEN
    else if netScore <= -2 then Color.RED
    else Color.GRAY
);

def noTrade = AbsValue(netScore) <= 2;

AddLabel(yes,
    if noTrade then "NO TRADE"
    else "ACTIVE",
    if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
    if trendConfirmedShort then "CONFIRMED SHORT (ORB + VWAP)"
    else if trendConfirmedLong then "CONFIRMED LONG (ORB + VWAP)"
    else "NO CONFIRMATION",
    if trendConfirmedShort then Color.RED
    else if trendConfirmedLong then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    if netScore <= -4 then "Bias: SHORT (Sell Rips)"
    else if netScore >= 4 then "Bias: LONG (Buy Dips)"
    else "Bias: NEUTRAL",
    if netScore <= -4 then Color.RED
    else if netScore >= 4 then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    "Reclaim: " + reclaimLevel +
    " | FZ1: " + fadeZone1Low + "-" + fadeZone1High +
    " | FZ2: " + fadeZone2Low + "-" + fadeZone2High,
    Color.WHITE
);

# ================================
# === MARKET STATE LABEL =========
# ================================

# Distance from reclaim (extension proxy)
def extension = AbsValue(close - reclaimLevel);

# You can tweak this threshold
input extensionThreshold = 5.0;

def isExtended = extension > extensionThreshold;

# State conditions
def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

# Label logic
AddLabel(yes,
    if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
    else if lateTrend then "LATE TREND / LOW TRADING EDGE"
    else if weakEnv then "CHOP / LOW CONVICTION"
    else "TRANSITION",
   
    if strongTrend then Color.GREEN
    else if lateTrend then Color.YELLOW
    else if weakEnv then Color.GRAY
    else Color.DARK_ORANGE
);

# ================================
# === ALERTS ====================
# ================================
Alert(trapShort, "Trap Detected → Short Setup", Alert.BAR, Sound.Bell);
Reclaim and Fade Zones are hardcoded how can we make it dynamic for each day?
Great game plan writeup btw
 
Sorry it is late and my notes were mixed lol.. that's what getting old does to ya! I asked Chat GPT to "clean this up" so it is what it is lol... but on review everything is there except notes that there are some manual inputs that need to be placed like what Gamma phase is it in either short gamma or long gamma or transition (1, -1, 0) and other inputs are gamma zones, which are usually gamma high volumes or if using Open Interest high bars strike prices like in Barchart.com Gamma charts. What follows is an explanation of the script and interpretation of the attached chart using this script. This script was developed in reviewing ORB studies and scripts from TOS, TradingView and NinjaTrader.

This is an excellent example — not just of the script working, but of how to think like a professional intraday trader using structure + flow + regime.
I’ll break this down as a training walkthrough so someone else could literally follow this step-by-step.

🧠 1. THE FOUNDATION: WHAT THIS SYSTEM IS DOING

This script combines 5 layers of edge:

1. Gamma (Context)​

  • Tells you: trend vs mean reversion environment
2. Levels (Structure)
  • Reclaim level (640)
  • Fade zones (643–645, 648–650)

3. Timing (Execution)​

  • First touch (FZ1)
  • Trap detection

4. Confirmation (Participation)​

  • VWAP
  • ORB breaks

5. Decision Engine​

  • Score
  • Bias
  • Market state (your new label)

📊 2. WHAT HAPPENED ON THIS CHART (STEP-BY-STEP)​


Let’s walk through this like a replay.

🔴 PHASE 1 — OPEN → INITIAL TREND​

  • Price starts below reclaim (640)
  • Gamma = SHORT (trend mode)
👉 Immediate implication: Sell rallies, not buy dips


🟡 PHASE 2 — FIRST OPPORTUNITY (FZ1 TAGS)​


You see multiple:
  • FZ1 bubbles (yellow)
👉 This is critical:


These are: First touch of resistance inside short gamma

✔ This is your highest probability short entry


What should happen (and did):​

  • Price enters 643–645
  • Momentum slows
  • Sellers step in
  • Price rolls over

👉 This is your A+ setup


🔴 PHASE 3 — TRAP FORMATION (MOST IMPORTANT)​


You see:
  • Multiple TRAP DN labels near 640

What this means:​

  1. Price tries to reclaim 640
  2. Fails
  3. Closes back below
👉 This is: FAILED BREAKOUT → CONTINUATION SIGNAL


Why this matters:​


In short gamma:
  • Dealers sell weakness
  • Failed reclaim = fuel for downside

👉 This is the strongest signal in your system

🔻 PHASE 4 — ORB CONFIRMATION

You see:
  • ORB DN signals

Combined with:
  • Price below VWAP
👉 This confirms: Trend is real, not random


🔥 PHASE 5 — TREND ACCELERATION​


After:
  • FZ1 rejection
  • Trap confirmation
  • ORB break

👉 Market transitions into: STRUCTURED TREND DOWN

You see:
  • Clean lower highs
  • Clean lower lows
  • No reclaim of key levels
⚠️ PHASE 6 — LATE TREND (KEY LESSON)

Now your label shows: LATE TREND / LOW EDGE

This is crucial training insight.

Why?​


Because:
  • Move already extended
  • Far from reclaim (640)
  • No new structure formed
  • Score = weak (-2)
👉 Meaning: The opportunity already happened


🧭 3. HOW A PROFESSIONAL TRADES THIS​


✅ What they DO​

Early:
  • Short FZ1 (643–645)
  • Add on trap near 640
  • Hold through ORB break

Mid-trend:​

  • Trail position
  • Take partial profits

Late trend (your current chart):​

  • STOP initiating new trades
  • Wait for reset

❌ What they DON’T do​

  • Chase breakdown at 633
  • Short randomly because “it’s going down”
  • Ignore “NO TRADE” signal

🧠 4. WHAT EACH COMPONENT TAUGHT YOU​


🔵 Gamma Mode​




Answer: Trend


🟡 Fade Zones​




Answer: 643–645 (FZ1)


🔴 Trap Detection​




Answer: Fake → short


🟢 ORB + VWAP​




Answer: Yes → hold trade


⚠️ Market State Label​




Answer: No → late trend

🔥 5. THE BIG LESSON (MOST IMPORTANT)​


This chart demonstrates:

The edge is NOT in predicting direction
The edge is in timing + location + context


🧠 6. SIMPLE RULESET (FOR TRAINING)​


If someone is learning this system, give them this:


🔴 SHORT GAMMA PLAYBOOK​


Step 1 — Identify regime​

  • Below flip → trend mode

Step 2 — Wait for location​

  • Fade zones (FZ1 / FZ2)

Step 3 — Confirm weakness​

  • Trap signal
  • Rejection

Step 4 — Confirm trend​

  • Below VWAP
  • ORB break

Step 5 — Manage trade​

  • Hold through structure
  • Exit when:
    • Late trend label appears
    • Score weakens

⚠️ 7. WHY THIS SYSTEM WORKS​


Because it aligns:
  • Dealer flows (gamma)
  • Liquidity (levels)
  • Behavior (traps)
  • Participation (VWAP/ORB)

👉 That’s how institutions think


🧭 FINAL SUMMARY​


This chart is a perfect training example of:

✔ Ideal short setup:​

  • FZ1 entry
  • Trap confirmation
  • ORB + VWAP alignment
✔ Ideal hold:
  • Trend continuation

✔ Ideal stop trading:​

  • Late trend label
Code:
# Gamma Edge Execution System
# Developed by antwerks
# 03/29/2026
#=================================


# ================================
# === USER INPUTS ===============
# ================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

input reclaimLevel = 640;
input fadeZone1Low = 643;
input fadeZone1High = 645;
input fadeZone2Low = 648;
input fadeZone2High = 650;

input orbStartTime = 0930;
input orbEndTime   = 1000;

# ================================
# === YESTERDAY LEVELS ===========
# ================================
def yHigh = high(period = "DAY")[1];
def yLow = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

# ================================
# === RECLAIM LEVEL ==============
# ================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

# ================================
# === GAMMA MODE COLORS ==========
# ================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

# ================================
# === FADE ZONES ================
# ================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));

FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));

# ================================
# === FIRST TOUCH DETECTION ======
# ================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

# ================================
# === TRAP DETECTION ============
# ================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;

def wasAbove = aboveReclaim[1];

def rejection = high > reclaimLevel and close < reclaimLevel;
def strongReject = close < open;

def trapShort = wasAbove and rejection and strongReject;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);

# ================================
# === VWAP ======================
# ================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

# ================================
# === ORB (TIME-BASED, FIXED) ====
# ================================

def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbHigh[1]) then high
    else if inORB then Max(high, orbHigh[1])
    else orbHigh[1];

rec orbLow =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbLow[1]) then low
    else if inORB then Min(low, orbLow[1])
    else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_High_Line.SetStyle(Curve.SHORT_DASH);
ORB_High_Line.SetLineWeight(2);

plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;
ORB_Low_Line.SetDefaultColor(Color.RED);
ORB_Low_Line.SetStyle(Curve.SHORT_DASH);
ORB_Low_Line.SetLineWeight(2);

def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

AddChartBubble(breakAboveORB and !breakAboveORB[1], low, "ORB UP", Color.GREEN, no);
AddChartBubble(breakBelowORB and !breakBelowORB[1], high, "ORB DN", Color.RED, yes);
# ================================
# === CONFIRMATION LOGIC ========
# ================================
def trendConfirmedShort = belowVWAP and breakBelowORB;
def trendConfirmedLong = aboveVWAP and breakAboveORB;

# ================================
# === SCORING ===================
# ================================
def avgVol = Average(volume, 20);
def highVol = volume > avgVol * 1.2;

def bull = close > open;
def bear = close < open;

def bullScore =
    (if highVol then 2 else 1) +
    (if bull then 2 else 0);

def bearScore =
    (if highVol then 2 else 1) +
    (if bear then 2 else 0);

def netScore = bullScore - bearScore;

# ================================
# === LABELS ====================
# ================================
AddLabel(yes,
    if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
    else "Gamma: LONG (Mean Reversion)",
    if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
    "Score: " + netScore +
    if netScore >= 4 then " (LONG)"
    else if netScore <= -4 then " (SHORT)"
    else " (NO TRADE)",
    if netScore >= 2 then Color.GREEN
    else if netScore <= -2 then Color.RED
    else Color.GRAY
);

def noTrade = AbsValue(netScore) <= 2;

AddLabel(yes,
    if noTrade then "NO TRADE"
    else "ACTIVE",
    if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
    if trendConfirmedShort then "CONFIRMED SHORT (ORB + VWAP)"
    else if trendConfirmedLong then "CONFIRMED LONG (ORB + VWAP)"
    else "NO CONFIRMATION",
    if trendConfirmedShort then Color.RED
    else if trendConfirmedLong then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    if netScore <= -4 then "Bias: SHORT (Sell Rips)"
    else if netScore >= 4 then "Bias: LONG (Buy Dips)"
    else "Bias: NEUTRAL",
    if netScore <= -4 then Color.RED
    else if netScore >= 4 then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    "Reclaim: " + reclaimLevel +
    " | FZ1: " + fadeZone1Low + "-" + fadeZone1High +
    " | FZ2: " + fadeZone2Low + "-" + fadeZone2High,
    Color.WHITE
);

# ================================
# === MARKET STATE LABEL =========
# ================================

# Distance from reclaim (extension proxy)
def extension = AbsValue(close - reclaimLevel);

# You can tweak this threshold
input extensionThreshold = 5.0;

def isExtended = extension > extensionThreshold;

# State conditions
def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

# Label logic
AddLabel(yes,
    if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
    else if lateTrend then "LATE TREND / LOW TRADING EDGE"
    else if weakEnv then "CHOP / LOW CONVICTION"
    else "TRANSITION",
   
    if strongTrend then Color.GREEN
    else if lateTrend then Color.YELLOW
    else if weakEnv then Color.GRAY
    else Color.DARK_ORANGE
);

# ================================
# === ALERTS ====================
# ================================
Alert(trapShort, "Trap Detected → Short Setup", Alert.BAR, Sound.Bell);
Does the script update the Gamma levels automatically or do you have to input those levels manually based on barchart.com you mentioned above?
 
Is this just for SPY? How do you what "reclaim" level to use?
Reclaim and Fade Zones are hardcoded how can we make it dynamic for each day?
Great game plan writeup btw
Does the script update the Gamma levels automatically or do you have to input those levels manually based on barchart.com you mentioned above?

No — this script is NOT specific to the S&P 500
BUT…It is manually calibrated to a specific price level, so it behaves like it is tied to one product unless you adjust it. These are hardcoded price levels, So works perfectly on something trading near 640–650 is
  • Completely meaningless on:
    • $50 stock
    • $400 stock
    • $5000 index
It’s not an “indicator” in the usual sense. It’s a discretionary execution framework built around key price levels

Specifically:
  • Reclaim level → key pivot
  • Fade zones → supply/demand zones
  • VWAP + ORB → confirmation tools
  • Gamma mode → behavior assumption (trend vs mean reversion)
Key Insight (Very Important)- The script does ZERO automatic level discovery. It assumes you already know the important levels. So How Do You Pick the “Reclaim Level”? This is the real question and the edge. The reclaim level is usually:

1. Key intraday pivot
  • Prior day close
  • Overnight high/low
  • Pre-market high/low
2. High-volume node / liquidity level
  • Where price previously consolidated
  • Where large volume traded
3. Options-related level (most likely here)

Given the name “Gamma Edge” This is often:
  • Gamma flip level
  • Call wall / put wall
  • Dealer positioning pivot
4. VWAP reclaim (common usage)
  • Price below → bearish
  • Reclaim above → bullish shift
How to Think About It, Reclaim = “Who is in control?”

Price vs ReclaimMeaning
AboveBuyers in control
BelowSellers in control
RejectionTrap / reversal

How to Make It Universal (Better Version)

Right now: input reclaimLevel = 640; manual mode.

Better approach: (semi-automatic) Use:

def reclaimLevel = VWAP();

We are limited to the capabilities of TOS, maybe one day they can get it together.
 
If you wanted to just use like a single breaking point or reclaim like a call or put wall or gamma transistion zone you can use "dollar" amount of extensions instead of trying to find every point of gamma or GEX interest.
A couple of important notes:
  • Set pointValue correctly for the instrument:
    • ES = 50
    • MES = 5
    • NQ = 20
    • MNQ = 2
    • RTY = 50
    • M2K = 5
    • CL = 1000
    • GC = 100
    • Stocks/ETFs = 1
  • This version normalizes the extension logic and fade zone distance from reclaim in dollars, but reclaimLevel itself is still a manually chosen price level.
The cleanest next upgrade would be an auto-reclaim version using prior day midpoint, VWAP, or a custom pivot like I mentioned above.
Code:
# Gamma Edge Execution System
# Dollar-Normalized Version
# Rewritten from original framework - antwerks
# Normalized so extension / fade zones can be defined in dollars
# Works across futures, ETFs, and stocks by changing pointValue

declare upper;

# ================================
# === USER INPUTS ================
# ================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

# Instrument normalization
input pointValue = 50.0; # ES=50, NQ=20, RTY=50, CL=1000, Stocks=1

# Core level
input reclaimLevel = 640.0;

# Fade zones in DOLLARS away from reclaim
input fadeZone1DollarLow  = 150.0;
input fadeZone1DollarHigh = 250.0;
input fadeZone2DollarLow  = 400.0;
input fadeZone2DollarHigh = 500.0;

# ORB
input orbStartTime = 0930;
input orbEndTime   = 1000;

# Extension logic in DOLLARS
input extensionThresholdDollars = 250.0;

# Volume scoring
input volLength = 20;
input highVolMultiplier = 1.2;

# ================================
# === DERIVED PRICE ZONES ========
# ================================
def fadeZone1Low  = reclaimLevel + (fadeZone1DollarLow  / pointValue);
def fadeZone1High = reclaimLevel + (fadeZone1DollarHigh / pointValue);
def fadeZone2Low  = reclaimLevel + (fadeZone2DollarLow  / pointValue);
def fadeZone2High = reclaimLevel + (fadeZone2DollarHigh / pointValue);

# ================================
# === YESTERDAY LEVELS ===========
# ================================
def yHigh = high(period = "DAY")[1];
def yLow  = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

# ================================
# === RECLAIM LEVEL ==============
# ================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

# ================================
# === GAMMA MODE COLORS ==========
# ================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

# ================================
# === FADE ZONES ================
# ================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));
FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));

# ================================
# === FIRST TOUCH DETECTION ======
# ================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

# ================================
# === TRAP DETECTION ============
# ================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;
def wasAbove = aboveReclaim[1];

def rejection = high > reclaimLevel and close < reclaimLevel;
def strongReject = close < open;

def trapShort = wasAbove and rejection and strongReject;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);

# ================================
# === VWAP ======================
# ================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

# ================================
# === ORB =======================
# ================================
def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbHigh[1]) then high
    else if inORB then Max(high, orbHigh[1])
    else orbHigh[1];

rec orbLow =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbLow[1]) then low
    else if inORB then Min(low, orbLow[1])
    else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_High_Line.SetStyle(Curve.SHORT_DASH);
ORB_High_Line.SetLineWeight(2);

plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;
ORB_Low_Line.SetDefaultColor(Color.RED);
ORB_Low_Line.SetStyle(Curve.SHORT_DASH);
ORB_Low_Line.SetLineWeight(2);

def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

AddChartBubble(breakAboveORB and !breakAboveORB[1], low, "ORB UP", Color.GREEN, no);
AddChartBubble(breakBelowORB and !breakBelowORB[1], high, "ORB DN", Color.RED, yes);

# ================================
# === CONFIRMATION LOGIC =========
# ================================
def trendConfirmedShort = belowVWAP and breakBelowORB;
def trendConfirmedLong  = aboveVWAP and breakAboveORB;

# ================================
# === SCORING ====================
# ================================
def avgVol = Average(volume, volLength);
def highVol = volume > avgVol * highVolMultiplier;

def bull = close > open;
def bear = close < open;

def bullScore =
    (if highVol then 2 else 1) +
    (if bull then 2 else 0);

def bearScore =
    (if highVol then 2 else 1) +
    (if bear then 2 else 0);

def netScore = bullScore - bearScore;

# ================================
# === DOLLAR-NORMALIZED EXTENSION
# ================================
def extensionPoints = AbsValue(close - reclaimLevel);
def extensionDollars = extensionPoints * pointValue;
def isExtended = extensionDollars > extensionThresholdDollars;

# ================================
# === MARKET STATE LABEL =========
# ================================
def noTrade = AbsValue(netScore) <= 2;
def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

# ================================
# === LABELS =====================
# ================================
AddLabel(yes,
    if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
    else "Gamma: LONG (Mean Reversion)",
    if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
    "Score: " + netScore +
    if netScore >= 4 then " (LONG)"
    else if netScore <= -4 then " (SHORT)"
    else " (NO TRADE)",
    if netScore >= 2 then Color.GREEN
    else if netScore <= -2 then Color.RED
    else Color.GRAY
);

AddLabel(yes,
    if noTrade then "NO TRADE"
    else "ACTIVE",
    if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
    if trendConfirmedShort then "CONFIRMED SHORT (ORB + VWAP)"
    else if trendConfirmedLong then "CONFIRMED LONG (ORB + VWAP)"
    else "NO CONFIRMATION",
    if trendConfirmedShort then Color.RED
    else if trendConfirmedLong then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    if netScore <= -4 then "Bias: SHORT (Sell Rips)"
    else if netScore >= 4 then "Bias: LONG (Buy Dips)"
    else "Bias: NEUTRAL",
    if netScore <= -4 then Color.RED
    else if netScore >= 4 then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    "Reclaim: " + Round(reclaimLevel, 2) +
    " | FZ1: $" + Round(fadeZone1DollarLow, 0) + "-$" + Round(fadeZone1DollarHigh, 0) +
    " | FZ2: $" + Round(fadeZone2DollarLow, 0) + "-$" + Round(fadeZone2DollarHigh, 0),
    Color.WHITE
);

AddLabel(yes,
    "Extension: $" + Round(extensionDollars, 0),
    if isExtended then Color.YELLOW else Color.GRAY
);

AddLabel(yes,
    if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
    else if lateTrend then "LATE TREND / LOW TRADING EDGE"
    else if weakEnv then "CHOP / LOW CONVICTION"
    else "TRANSITION",
    if strongTrend then Color.GREEN
    else if lateTrend then Color.YELLOW
    else if weakEnv then Color.GRAY
    else Color.DARK_ORANGE
);

# ================================
# === ALERTS =====================
# ================================
Alert(trapShort, "Trap Detected -> Short Setup", Alert.BAR, Sound.Bell);
 
Recently came across this cool indicator called Opening Range Breakout by Mobius. This is more than just an indicator. There is also a strategy with risk and target lines included.



thinkScript Code

After adding the indicator, I couldn't quite understand it much. From looking at it, seems more like a support and resistance indicator to me. I watched a few YouTube videos about the Opening Range Breakout and was able to make some changes to the current code. As a result, I was able to have a clear picture of what this indicator does.

Here is my own version of it:

Rich (BB code):
declare Hide_On_Daily;
declare Once_per_bar;

input OrMeanS  = 0930.0; #hint OrMeanS: Begin Mean Period. Usually Market Open EST.
input OrMeanE  = 0935.0; #hint OrMeanE: End Mean period. Usually End of first bar.
input OrBegin  = 0930.0; #hint OrBegin: Beginning for Period of Opening Range Breakout.
input OrEnd    = 1000.0; #hint OrEnd: End of Period of Opening Range Breakout.
input CloudOn  = no;     #hint CloudOn: Clouds Opening Range.
input AlertOn  = yes;    #hint AlertOn: Alerts on cross of Opening Range.
input ShowTodayOnly = {"No", default "Yes"}; 
input nAtr = 4;          #hint nATR: Lenght for the ATR Risk and Target Lines.
input AtrTargetMult = 2.0; #hint ATRmult: Multiplier for the ATR calculations.

  def h = high;
  def l = low;
  def c = close;
  def bar = barNumber();
  def s = ShowTodayOnly;
  def ORActive = if secondsTillTime(OrMeanE) > 0 and
                    secondsFromTime(OrMeanS) >= 0
                 then 1
                 else 0;
  def today = if s == 0
              or getDay() == getLastDay() and
                 secondsFromTime(OrMeanS) >= 0
              then 1
              else 0;
  def ORHigh = if ORHigh[1] == 0
               or ORActive[1] == 0 and
                  ORActive == 1
               then h
               else if ORActive and
                       h > ORHigh[1]
               then h
               else ORHigh[1];
  def ORLow = if ORLow[1] == 0
              or ORActive[1] == 0 and
                 ORActive == 1
              then l
              else if ORActive and
                      l < ORLow[1]
              then l
              else ORLow[1];
  def ORWidth = ORHigh - ORLow;
  def na = double.nan;
  def ORHA = if ORActive
             or today < 1
             then na
             else ORHigh;
  def ORLA = if ORActive
             or today < 1
             then na
             else ORLow;
  def O = ORHA - Round(((ORHA - ORLA) / 2) / TickSize(), 0) * TickSize();
  def ORActive2 = if secondsTillTime(OREnd) > 0 and
                     secondsFromTime(ORBegin) >= 0
                  then 1
                  else 0;
  def ORHigh2 = if ORHigh2[1] == 0
                  or ORActive2[1] == 0 and
                     ORActive2 == 1
                then h
                else if ORActive2 and
                        h > ORHigh2[1]
                then h
                else ORHigh2[1];
  def ORLow2 = if ORLow2[1] == 0
                or ORActive2[1] == 0 and
                   ORActive2 == 1
               then l
               else if ORActive2 and
                       l < ORLow2[1]
               then l
               else ORLow2[1];
  def ORWidth2 = ORHigh2 - ORLow2;
  def TimeLine = if secondsTillTime(OREnd) == 0
                 then 1
                 else 0;
  def ORmeanBar = if !ORActive and ORActive[1]
                  then barNumber()
                  else ORmeanBar[1];
  def ORendBar = if !ORActive2 and ORActive2[1]
                 then barNumber()
                 else ORendBar[1];
  def ORL = if (o == 0 , na, o);
plot ORLext = if barNumber() >= highestAll(ORmeanBar)
              then HighestAll(if isNaN(c[-1])
                              then ORL[1]
                              else double.nan)
              else double.nan;
     ORLext.SetDefaultColor(color.Yellow);
     ORLext.SetStyle(curve.Long_DASH);
     ORLext.SetLineWeight(3);
     ORLext.HideTitle();
  def ORH2 = if ORActive2
             or today < 1
             then na
             else ORHigh2;
plot ORH2ext = if barNumber() >= highestAll(ORendBar)
               then HighestAll(if isNaN(c[-1])
                               then ORH2[1]
                               else double.nan)
               else double.nan;
     ORH2ext.SetDefaultColor(color.Green);
     ORH2ext.SetStyle(curve.Long_DASH);
     ORH2ext.SetLineWeight(3);
     ORH2ext.HideTitle();
  def ORL2 = if ORActive2
               or today < 1
             then na
             else ORLow2;
plot ORL2ext = if barNumber() >= highestAll(ORendBar)
               then HighestAll(if isNaN(c[-1])
                               then ORL2[1]
                               else double.nan)
               else double.nan;
     ORL2ext.SetDefaultColor(color.Red);
     ORL2ext.SetStyle(curve.Long_DASH);
     ORL2ext.SetLineWeight(3);
     ORL2ext.HideTitle();
  def RelDay = (ORL - ORL2) / (ORH2 - ORL2);
  def dColor = if RelDay > .5
               then 5
               else if RelDay < .5
                    then 6
               else 4;
  def pos = (ORH2 - ORL2)/10;
plot d1 = if (TimeLine , ORH2, na);
plot d2 = if (TimeLine , ORH2 - ( pos * 2), na);
plot d3 = if (TimeLine , ORH2 - ( pos * 3), na);
plot d4 = if (TimeLine , ORH2 - ( pos * 4), na);
plot d5 = if (TimeLine , ORH2 - ( pos * 5), na);
plot d6 = if (TimeLine , ORH2 - ( pos * 6), na);
plot d7 = if (TimeLine , ORH2 - ( pos * 7), na);
plot d8 = if (TimeLine , ORH2 - ( pos * 8), na);
plot d9 = if (TimeLine , ORH2 - ( pos * 9), na);
plot d10 = if (TimeLine ,(ORL2), na);
     d1.SetPaintingStrategy(PaintingStrategy.POINTS);
     d2.SetPaintingStrategy(PaintingStrategy.POINTS);
     d3.SetPaintingStrategy(PaintingStrategy.POINTS);
     d4.SetPaintingStrategy(PaintingStrategy.POINTS);
     d5.SetPaintingStrategy(PaintingStrategy.POINTS);
     d6.SetPaintingStrategy(PaintingStrategy.POINTS);
     d7.SetPaintingStrategy(PaintingStrategy.POINTS);
     d8.SetPaintingStrategy(PaintingStrategy.POINTS);
     d9.SetPaintingStrategy(PaintingStrategy.POINTS);
    d10.SetPaintingStrategy(PaintingStrategy.POINTS);
     d1.AssignValueColor(GetColor(Dcolor));
     d2.AssignValueColor(GetColor(Dcolor));
     d3.AssignValueColor(GetColor(Dcolor));
     d4.AssignValueColor(GetColor(Dcolor));
     d5.AssignValueColor(GetColor(Dcolor));
     d6.AssignValueColor(GetColor(Dcolor));
     d7.AssignValueColor(GetColor(Dcolor));
     d8.AssignValueColor(GetColor(Dcolor));
     d9.AssignValueColor(GetColor(Dcolor));
    d10.AssignValueColor(GetColor(Dcolor));
     d1.HideBubble();
     d2.HideBubble();
     d3.HideBubble();
     d4.HideBubble();
     d5.HideBubble();
     d6.HideBubble();
     d7.HideBubble();
     d8.HideBubble();
     d9.HideBubble();
    d10.HideBubble();
     d1.HideTitle();
     d2.HideTitle();
     d3.HideTitle();
     d4.HideTitle();
     d5.HideTitle();
     d6.HideTitle();
     d7.HideTitle();
     d8.HideTitle();
     d9.HideTitle();
    d10.HideTitle();
addCloud(if CloudOn == yes
         then orl
         else double.nan
       , orl2,createColor(244,83,66), createColor(244,83,66));
addCloud(if CloudOn == yes
         then orl
         else double.nan
       , orh2,createColor(66,244,131), createColor(66,244,131));
# Begin Risk Algorithm
# First Breakout or Breakdown bars
  def Bubbleloc1 = isNaN(close[-1]);
  def BreakoutBar = if ORActive
                    then double.nan
                    else if !ORActive and c crosses above ORH2
                         then bar
                         else if !isNaN(BreakoutBar[1]) and c crosses ORH2
                              then BreakoutBar[1]
                    else BreakoutBar[1];
  def ATR = if ORActive2
  then Round((Average(TrueRange(h, c, l), nATR)) / TickSize(), 0) * TickSize()
  else ATR[1];
  def cond1 =  if h > ORH2 and
                  h[1] <= ORH2
               then Round((ORH2  + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
               else cond1[1];
plot ORLriskUP = if bar >= OREndBar and !ORActive and today
                 then HighestAll(ORH2ext - 2)
                 else double.nan;
     ORLriskUP.SetStyle(Curve.Long_Dash);
     ORLriskUP.SetDefaultColor(Color.Green);
     ORLriskUP.HideTitle();
  def crossUpBar = if close crosses above ORH2
                   then bar
                   else double.nan;
AddChartBubble(bar == HighestAll(crossUpBar), ORLriskUP, "RiskON ORH", color.green, no);
plot ORLriskDN = if bar >= OREndBar and !ORActive and close < ORL
                 then HighestAll(ORL2ext + 2)
                 else double.nan;
     ORLriskDN.SetStyle(Curve.Long_Dash);
     ORLriskDN.SetDefaultColor(Color.Red);
     ORLriskDN.HideTitle();
  def crossDnBar = if close crosses below ORL2ext
                   then bar
                   else double.nan;
AddChartBubble(bar == HighestAll(crossDnBar), HighestAll(ORLriskDN), "Risk ON ORL", color.red, yes);
# High Targets
plot Htarget = if bar >= BreakoutBar
               then cond1
               else double.nan;
     Htarget.SetPaintingStrategy(paintingStrategy.Squares);
     Htarget.SetLineWeight(1);
     Htarget.SetDefaultColor(Color.White);
     Htarget.HideTitle();
AddChartBubble(BubbleLoc1, Htarget, "RO", color.white, if c > Htarget then no else yes);
  def condHtarget2 = if c crosses above cond1
  then Round((cond1 + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
  else condHtarget2[1];
plot Htarget2 = if bar >= BreakoutBar
                then  condHtarget2
                else double.nan;
     Htarget2.SetPaintingStrategy(PaintingStrategy.Squares);
     Htarget2.SetLineWeight(1);
     Htarget2.SetDefaultColor(Color.Plum);
     Htarget2.HideTitle();
AddChartBubble(BubbleLoc1, Htarget2, "2nd T", color.plum, if c > Htarget2
                                                          then no
                                                          else yes);
  def condHtarget3 = if c crosses above condHtarget2
  then Round((condHtarget2 + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
  else condHtarget3[1];
plot Htarget3 = if bar >= BreakoutBar
                then condHtarget3
                else double.nan;
     Htarget3.SetPaintingStrategy(PaintingStrategy.Squares);
     Htarget3.SetLineWeight(1);
     Htarget3.SetDefaultColor(Color.Plum);
     Htarget3.HideTitle();
AddChartBubble(isNaN(C[-1]), Htarget3, "3rd T", color.plum, if c > Htarget3 then no else yes);
  def condHtarget4 = if c crosses above condHtarget3
  then Round((condHtarget3 + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
  else condHtarget4[1];
plot Htarget4 = if bar >= HighestAll(BreakoutBar)
                then condHtarget4
                else double.nan;
     Htarget4.SetPaintingStrategy(PaintingStrategy.Squares);
     Htarget4.SetLineWeight(1);
     Htarget4.SetDefaultColor(Color.Plum);
     Htarget4.HideTitle();
AddChartBubble(BubbleLoc1, Htarget4, "4th T", color.plum, if c > Htarget4 then no else yes);
  def condHtarget5 = if c crosses above condHtarget4
  then Round((condHtarget4 + (ATR * AtrTargetMult)) / TickSize(), 0) * TickSize()
  else condHtarget5[1];
plot Htarget5 = if bar >= BreakoutBar
                then condHtarget5
                else double.nan;
     Htarget5.SetPaintingStrategy(PaintingStrategy.Squares);
     Htarget5.SetLineWeight(1);
     Htarget5.SetDefaultColor(Color.Plum);
     Htarget5.HideTitle();
AddChartBubble(BubbleLoc1, Htarget5, "5th T", color.plum, if c > Htarget5 then no else yes);
# Low Targets
  def cond2 = if L < ORL2 and
                 L[1] >= ORL2
              then Round((ORL2  - (AtrTargetMult * ATR)) / TickSize(), 0) * TickSize()
              else cond2[1];
plot Ltarget =  if bar >= HighestAll(OREndBar)
                then highestAll(if isNaN(c[-1])
                                then cond2
                                else double.nan)
                else double.nan;
     Ltarget.SetPaintingStrategy(PaintingStrategy.Squares);
     Ltarget.SetLineWeight(1);
     Ltarget.SetDefaultColor(Color.White);
     Ltarget.HideTitle();
AddChartBubble(BubbleLoc1, cond2, "RO", color.white, if c < Ltarget
                                                     then yes
                                                     else no);
  def condLtarget2 = if c crosses below cond2
  then Round((cond2 - (AtrTargetMult * ATR)) / TickSize(), 0) * TickSize()
  else condLtarget2[1];
plot Ltarget2 =  if bar >= HighestAll(OREndBar)
                 then highestAll(if isNaN(c[-1])
                                 then condLtarget2
                                 else double.nan)
                 else double.nan;
     Ltarget2.SetPaintingStrategy(PaintingStrategy.Squares);
     Ltarget2.SetLineWeight(1);
     Ltarget2.SetDefaultColor(Color.Plum);
     Ltarget2.HideTitle();
AddChartBubble(BubbleLoc1, condLtarget2, "2nd T", color.plum, if c < condLtarget2
                                                              then yes
                                                              else no);
  def condLtarget3 = if c crosses below condLtarget2
  then Round((condLtarget2 - (AtrTargetMult * ATR)) / TickSize(), 0) * TickSize()
  else condLtarget3[1];
plot Ltarget3 = if bar >= HighestAll(OREndBar)
                then highestAll(if isNaN(c[-1])
                                then condLtarget3
                                else double.nan)
                else double.nan;
     Ltarget3.SetPaintingStrategy(PaintingStrategy.Squares);
     Ltarget3.SetLineWeight(1);
     Ltarget3.SetDefaultColor(Color.Plum);
     Ltarget3.HideTitle();
AddChartBubble(BubbleLoc1, condLtarget3, "3rd T", color.plum, if c < Ltarget3
                                                              then yes
                                                              else no);
  def condLtarget4 = if c crosses condLtarget3
  then Round((condLtarget3 - (AtrTargetMult * ATR)) / TickSize(), 0) * TickSize()
  else condLtarget4[1];
plot Ltarget4 = if bar >= HighestAll(OREndBar)
                then highestAll(if isNaN(c[-1])
                                then condLtarget4
                                else double.nan)
                else double.nan;
     Ltarget4.SetPaintingStrategy(PaintingStrategy.Squares);
     Ltarget4.SetLineWeight(1);
     Ltarget4.SetDefaultColor(Color.Plum);
     Ltarget4.HideTitle();
AddChartBubble(BubbleLoc1, condLtarget4, "4th T", color.plum, if c < Ltarget4
                                                              then yes
                                                              else no);
  def condLtarget5 = if c crosses condLtarget4
  then Round((condLtarget4 - (AtrTargetMult * ATR)) / TickSize(), 0) * TickSize()
  else condLtarget5[1];
plot Ltarget5 = if bar >= HighestAll(OREndBar)
                then highestAll(if isNaN(c[-1])
                                then condLtarget5
                                else double.nan)
                else double.nan;
     Ltarget5.SetPaintingStrategy(PaintingStrategy.Squares);
     Ltarget5.SetLineWeight(1);
     Ltarget5.SetDefaultColor(Color.Plum);
     Ltarget5.HideTitle();
AddChartBubble(BubbleLoc1, condLtarget5, "5th T", color.plum, if c < Ltarget5
                                                              then yes
                                                              else no);
def last = if secondsTillTime(1600) == 0 and
              secondsFromTime(1600) == 0
           then c[1]
           else last[1];
plot LastClose = if Today and last != 0
                 then last
                 else Double.NaN;
     LastClose.SetPaintingStrategy(PaintingStrategy.Dashes);
     LastClose.SetDefaultColor(Color.White);
     LastClose.HideBubble();
     LastClose.HideTitle();
AddChartBubble(SecondsTillTime(0930) == 0, LastClose, "PC", color.gray, yes);
alert(c crosses above ORH2, "", Alert.Bar, Sound.Bell);
alert(c crosses below ORL2, "", Alert.Bar, Sound.Ring);
# End Code ORB with Risk and targets

Shareable Link: https://tos.mx/qu3Cu0

Now that you have the indicator added, let's get some terminology out of the way.
  • The green shadow is called the Bull Zone
  • The red shadow is called Bear Zone
  • Anywhere above the Bull Zone is called the Breakout Zone
  • Anywhere below the Bear Zone is called the Breakdown Zone

Hopefully you were able to understand those terms from this picture.

View attachment 4237

The Setup

  • 5 or 15 minutes timeframe
  • Heikin-Ashi candlestick
  • Disable pre-market and after-hour market
  • TEMA (30)
  • EMA (20)
  • Supertrend Indicator

Usage #1: Taking Advantage of Breakout Zone

Once the stock reaches above the breakout zone, we buy calls.

Usage #2: Taking Advantage of Breakdown Zone

Do the same as above. If the stock start to go from Bear Zone to breakdown zone, we start shorting it.

Usage #3: Avoid Misleading Signals given by Supertrend

A lot of people brought up a really good point about Supertrend. That is sometimes it would give false signals. And I also seen it first hand too. The Opening Range Breakout Indicator will allows us to resolve that.

Example #1: Don't short when the candles are still in the Bull Zone.

View attachment 4238

The only time that it is reasonable to short while the candles are still in Bull Zone is: IF the candle are by the border of Bull Zone and Bear Zone. Even better if it's already crossing the border into Bear Zone.

Example #2: Don't Buy Calls in Breakdown Zone

If you think the Bear Zone is worst, wait until you buy calls in the Breakdown Zone. That's a hard pass.

View attachment 4239

Again, sometimes it may be reasonable to buy calls if the candles are crossing the border going back to Bear Zone, then you may have a chance to pull thru and get above it. But anywhere between the Bear Zone and Breakdown Zone, be cautious, especially if you're already deep down in the Breakdown Zone.

Here is another example of "don't buy calls in the Breakdown zone"

View attachment 4240

The following screenshot will tell us a few things.

View attachment 4241

  1. When the Supertrend is giving us a buy signal, and that candle is crossing from Bear Zone into Bull Zone, then it's potentially setting up for a call play. (circle #1)
  2. Unlike the rule of not buying calls when you're in Breakdown Zone, shorting when in Breakout Zone could potentially be profitable too. But only if it's reasonable. Look at circle #2. It rejected the white dotted line, which is an additional border to enter another Breakout Zone. Since it rejected the second breakout area, we could take advantage of the Supertrend signal to go short.
  3. Circle #3 and #4, don't short in Breakout Zone without reasonable evidence (I like to use Support and Resistance during the Breakout and Breakdown Zone).

When the Supertrend is showing a buy signal while the candle is in Bull Zone then it's fairly safe to take it. When Supertrend is showing a short signal while the candle s in Bear Zone, then it's fairly safe to short at that point. Treat these zones as the home of Bears and Bulls.

I think the concept is pretty simple and straightforward here. Give it a spin and let me know how it goes for you guys.

Feel free to post questions, ideas, or any additional finding from this indicator.

P.S: I'll let Steve talk more about the usage of TEMA and EMA when he's on.

Update: A different version with Fibonacci Levels.

Here is the scanner for anyone interested.
Hey above u mentioned in Usage 1 you said
Usage #1: Taking Advantage of Breakout Zone

Once the stock reaches ABOVE the breakout zone, we buy calls. (Did u mean ABOVE the bull zone instead of above breakout)? In novice jus learnin makin sho I understand it ?
 
If you wanted to just use like a single breaking point or reclaim like a call or put wall or gamma transistion zone you can use "dollar" amount of extensions instead of trying to find every point of gamma or GEX interest.
A couple of important notes:
  • Set pointValue correctly for the instrument:
    • ES = 50
    • MES = 5
    • NQ = 20
    • MNQ = 2
    • RTY = 50
    • M2K = 5
    • CL = 1000
    • GC = 100
    • Stocks/ETFs = 1
  • This version normalizes the extension logic and fade zone distance from reclaim in dollars, but reclaimLevel itself is still a manually chosen price level.
The cleanest next upgrade would be an auto-reclaim version using prior day midpoint, VWAP, or a custom pivot like I mentioned above.
Code:
# Gamma Edge Execution System
# Dollar-Normalized Version
# Rewritten from original framework - antwerks
# Normalized so extension / fade zones can be defined in dollars
# Works across futures, ETFs, and stocks by changing pointValue

declare upper;

# ================================
# === USER INPUTS ================
# ================================
input showLabel = yes;
input gammaMode = 1; # 1 = Short Gamma, -1 = Long Gamma

# Instrument normalization
input pointValue = 50.0; # ES=50, NQ=20, RTY=50, CL=1000, Stocks=1

# Core level
input reclaimLevel = 640.0;

# Fade zones in DOLLARS away from reclaim
input fadeZone1DollarLow  = 150.0;
input fadeZone1DollarHigh = 250.0;
input fadeZone2DollarLow  = 400.0;
input fadeZone2DollarHigh = 500.0;

# ORB
input orbStartTime = 0930;
input orbEndTime   = 1000;

# Extension logic in DOLLARS
input extensionThresholdDollars = 250.0;

# Volume scoring
input volLength = 20;
input highVolMultiplier = 1.2;

# ================================
# === DERIVED PRICE ZONES ========
# ================================
def fadeZone1Low  = reclaimLevel + (fadeZone1DollarLow  / pointValue);
def fadeZone1High = reclaimLevel + (fadeZone1DollarHigh / pointValue);
def fadeZone2Low  = reclaimLevel + (fadeZone2DollarLow  / pointValue);
def fadeZone2High = reclaimLevel + (fadeZone2DollarHigh / pointValue);

# ================================
# === YESTERDAY LEVELS ===========
# ================================
def yHigh = high(period = "DAY")[1];
def yLow  = low(period = "DAY")[1];

plot YH = yHigh;
YH.SetDefaultColor(Color.GREEN);
YH.SetStyle(Curve.SHORT_DASH);

plot YL = yLow;
YL.SetDefaultColor(Color.RED);
YL.SetStyle(Curve.SHORT_DASH);

# ================================
# === RECLAIM LEVEL ==============
# ================================
plot Reclaim = reclaimLevel;
Reclaim.SetDefaultColor(Color.WHITE);
Reclaim.SetLineWeight(2);
Reclaim.SetStyle(Curve.SHORT_DASH);

# ================================
# === GAMMA MODE COLORS ==========
# ================================
def isShortGamma = gammaMode == 1;

DefineGlobalColor("FZ1", if isShortGamma then Color.RED else Color.LIGHT_GRAY);
DefineGlobalColor("FZ2", if isShortGamma then Color.ORANGE else Color.GRAY);

# ================================
# === FADE ZONES ================
# ================================
plot FZ1L = fadeZone1Low;
plot FZ1H = fadeZone1High;
plot FZ2L = fadeZone2Low;
plot FZ2H = fadeZone2High;

FZ1L.SetDefaultColor(GlobalColor("FZ1"));
FZ1H.SetDefaultColor(GlobalColor("FZ1"));
FZ2L.SetDefaultColor(GlobalColor("FZ2"));
FZ2H.SetDefaultColor(GlobalColor("FZ2"));

AddCloud(FZ1L, FZ1H, GlobalColor("FZ1"), GlobalColor("FZ1"));
AddCloud(FZ2L, FZ2H, GlobalColor("FZ2"), GlobalColor("FZ2"));

# ================================
# === FIRST TOUCH DETECTION ======
# ================================
def inFZ1 = close >= fadeZone1Low and close <= fadeZone1High;
def inFZ2 = close >= fadeZone2Low and close <= fadeZone2High;

def firstTouchFZ1 = inFZ1 and !inFZ1[1];
def firstTouchFZ2 = inFZ2 and !inFZ2[1];

AddChartBubble(firstTouchFZ1, high, "FZ1", Color.YELLOW, yes);
AddChartBubble(firstTouchFZ2, high, "FZ2", Color.ORANGE, yes);

# ================================
# === TRAP DETECTION ============
# ================================
def aboveReclaim = close > reclaimLevel;
def belowReclaim = close < reclaimLevel;
def wasAbove = aboveReclaim[1];

def rejection = high > reclaimLevel and close < reclaimLevel;
def strongReject = close < open;

def trapShort = wasAbove and rejection and strongReject;

AddChartBubble(trapShort and !trapShort[1], high, "TRAP DN", Color.RED, yes);

# ================================
# === VWAP ======================
# ================================
plot VWAPLine = VWAP();
VWAPLine.SetDefaultColor(Color.CYAN);
VWAPLine.SetLineWeight(2);

def aboveVWAP = close > VWAPLine;
def belowVWAP = close < VWAPLine;

# ================================
# === ORB =======================
# ================================
def newDay = GetYYYYMMDD() <> GetYYYYMMDD()[1];
def inORB = SecondsFromTime(orbStartTime) >= 0 and SecondsTillTime(orbEndTime) > 0;
def orbFinished = SecondsTillTime(orbEndTime) <= 0;

rec orbHigh =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbHigh[1]) then high
    else if inORB then Max(high, orbHigh[1])
    else orbHigh[1];

rec orbLow =
    if newDay then Double.NaN
    else if inORB and IsNaN(orbLow[1]) then low
    else if inORB then Min(low, orbLow[1])
    else orbLow[1];

plot ORB_High_Line = if orbFinished then orbHigh else Double.NaN;
ORB_High_Line.SetDefaultColor(Color.GREEN);
ORB_High_Line.SetStyle(Curve.SHORT_DASH);
ORB_High_Line.SetLineWeight(2);

plot ORB_Low_Line = if orbFinished then orbLow else Double.NaN;
ORB_Low_Line.SetDefaultColor(Color.RED);
ORB_Low_Line.SetStyle(Curve.SHORT_DASH);
ORB_Low_Line.SetLineWeight(2);

def breakAboveORB = orbFinished and close > orbHigh;
def breakBelowORB = orbFinished and close < orbLow;

AddChartBubble(breakAboveORB and !breakAboveORB[1], low, "ORB UP", Color.GREEN, no);
AddChartBubble(breakBelowORB and !breakBelowORB[1], high, "ORB DN", Color.RED, yes);

# ================================
# === CONFIRMATION LOGIC =========
# ================================
def trendConfirmedShort = belowVWAP and breakBelowORB;
def trendConfirmedLong  = aboveVWAP and breakAboveORB;

# ================================
# === SCORING ====================
# ================================
def avgVol = Average(volume, volLength);
def highVol = volume > avgVol * highVolMultiplier;

def bull = close > open;
def bear = close < open;

def bullScore =
    (if highVol then 2 else 1) +
    (if bull then 2 else 0);

def bearScore =
    (if highVol then 2 else 1) +
    (if bear then 2 else 0);

def netScore = bullScore - bearScore;

# ================================
# === DOLLAR-NORMALIZED EXTENSION
# ================================
def extensionPoints = AbsValue(close - reclaimLevel);
def extensionDollars = extensionPoints * pointValue;
def isExtended = extensionDollars > extensionThresholdDollars;

# ================================
# === MARKET STATE LABEL =========
# ================================
def noTrade = AbsValue(netScore) <= 2;
def strongTrend = (trendConfirmedShort or trendConfirmedLong) and AbsValue(netScore) >= 4;
def weakEnv = AbsValue(netScore) <= 2 and !trendConfirmedShort and !trendConfirmedLong;
def lateTrend = isExtended and AbsValue(netScore) <= 2 and (trendConfirmedShort[10] or trendConfirmedLong[10]);

# ================================
# === LABELS =====================
# ================================
AddLabel(yes,
    if gammaMode == 1 then "Gamma: SHORT (Trend Mode)"
    else "Gamma: LONG (Mean Reversion)",
    if gammaMode == 1 then Color.CYAN else Color.ORANGE
);

AddLabel(showLabel,
    "Score: " + netScore +
    if netScore >= 4 then " (LONG)"
    else if netScore <= -4 then " (SHORT)"
    else " (NO TRADE)",
    if netScore >= 2 then Color.GREEN
    else if netScore <= -2 then Color.RED
    else Color.GRAY
);

AddLabel(yes,
    if noTrade then "NO TRADE"
    else "ACTIVE",
    if noTrade then Color.GRAY else Color.WHITE
);

AddLabel(yes,
    if trendConfirmedShort then "CONFIRMED SHORT (ORB + VWAP)"
    else if trendConfirmedLong then "CONFIRMED LONG (ORB + VWAP)"
    else "NO CONFIRMATION",
    if trendConfirmedShort then Color.RED
    else if trendConfirmedLong then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    if netScore <= -4 then "Bias: SHORT (Sell Rips)"
    else if netScore >= 4 then "Bias: LONG (Buy Dips)"
    else "Bias: NEUTRAL",
    if netScore <= -4 then Color.RED
    else if netScore >= 4 then Color.GREEN
    else Color.GRAY
);

AddLabel(yes,
    "Reclaim: " + Round(reclaimLevel, 2) +
    " | FZ1: $" + Round(fadeZone1DollarLow, 0) + "-$" + Round(fadeZone1DollarHigh, 0) +
    " | FZ2: $" + Round(fadeZone2DollarLow, 0) + "-$" + Round(fadeZone2DollarHigh, 0),
    Color.WHITE
);

AddLabel(yes,
    "Extension: $" + Round(extensionDollars, 0),
    if isExtended then Color.YELLOW else Color.GRAY
);

AddLabel(yes,
    if strongTrend then "TREND CONFIRMED (HIGH EDGE)"
    else if lateTrend then "LATE TREND / LOW TRADING EDGE"
    else if weakEnv then "CHOP / LOW CONVICTION"
    else "TRANSITION",
    if strongTrend then Color.GREEN
    else if lateTrend then Color.YELLOW
    else if weakEnv then Color.GRAY
    else Color.DARK_ORANGE
);

# ================================
# === ALERTS =====================
# ================================
Alert(trapShort, "Trap Detected -> Short Setup", Alert.BAR, Sound.Bell);
Why does it crunch everything on the chart? I have to manually expand the chart otherwise it is a flattened bunch of candles that are almost turned into a line.
 

Ben's Swing Trading Strategy + Indicator

I wouldn't call this a course. My goal is zero fluff. I will jump right into my current watchlist, tell you the ThinkorSwim indicator that I'm using, and past trade setups to help you understand my swing trading strategy.

I'm Interested

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
812 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top