Overwatch:
Overwatch acts as a magnifying lens when the tape stretches, revealing how structure and volatility behave as the environment bends, compresses, expands, or destabilizes. It overcomes the limitations of relying on Z‑score alone when price pushes beyond 1.5, 2, or more—showing not just how far price has stretched, but whether that stretch is healthy, pressured, unstable, or aging.
Overwatch is a compact, operator‑grade panel that quietly monitors the market’s internal state in real time. It doesn’t predict, it doesn’t hype—it simply watches and reports the truth of the tape through four core instruments.
(Study Link)
Overwatch Shared Study Link: https://tos.mx/!tRKwg9E5
Pressure (P0–P4)
A six‑factor structural stress model grading the environment from calm (P0–P1) to directional pressure (P2), instability (P3), and critical stress (P4). Pressure reveals whether the trend is supported, strained, or breaking down.
MicroState
A structural read of the auction cycle:
Contracting → Coil → Expansion → Blowoff → Contracting
MicroState shows where price sits in its micro‑phase without assumptions or bias, revealing whether energy is building, releasing, or exhausting.
DOOM (Drift Oscillation & Overextension Monitor)
A volatility‑pressure gauge that tracks contraction, loading, expansion, and late‑phase blowoff behavior. Low DOOM reflects a quiet tape; rising DOOM signals pressure; high DOOM marks instability or overextension.
Exhaustion Ladder (Fade → TP Zone → TP → Trail Stop)
A timing model that reveals how a move ages. Fade marks the earliest curvature conflict, TP Zone provides an early heads‑up, TP confirms deceleration, and Trail Stop marks structural breakdown and volatility expansion. The ladder shows when a trend is stretching, weakening, and preparing to fail.
Reversal Ladder (Recover → Rev Zone → Rev → Trend Rebuild)
The structural mirror of the exhaustion ladder. Instead of aging a trend, it narrates how a down‑move unwinds, stabilizes, and transitions into a new cycle. Recover marks the first improvement in curvature, Rev Zone captures volatility collapse and stretch normalization, Rev identifies the first expansion of new energy, and Trend Rebuild confirms the shift as volatility re‑inflates and pressure flips supportive.
“Today’s NUGT move offered a clean look at how Overwatch narrates a strong trend environment in real time.”
(Chart Link)
Chart
User Inputs & Options
By default, the TP Z‑Dome clouds are enabled. The TP cloud is based on @Christopher84’s original confirmation candles, while the Z‑Dome was designed to ride above the TP upper STARC‑C band. Together they form a powerful visual of stretched conditions, showing both the structural and volatility‑based extremes of a move.
The label position places the study on the bottom‑right of the chart—right where the action is, and right where your eyes naturally go during live tape.
Side note: During development I mistyped dome as doom, chuckled a little, and kept the name.
Bottom line: If the DOOM meter is RED, the order is: “Man your Battle Stations.”
How to Use Overwatch
Overwatch is an environment model, not a signal generator. You use it the same way a pilot uses instruments: to understand the state of the environment, not to tell you what button to press. The workflow is simple and always follows the same sequence.
1. Pressure — Structural Integrity
Pressure is the first read because it tells you whether the environment is supportive, neutral, strained, or breaking down.
- P0–P1 — calm, supportive, low stress
- P2 — directional pressure
- P3 — instability
- P4 — critical stress
2. MicroState — Energy Cycle
MicroState shows where price sits in the auction cycle:
Contracting → Coil → Expansion → Blowoff → Contracting
It reveals whether energy is building, releasing, or exhausting.
Question: What phase of the energy cycle am I in?
3. DOOM — Volatility Pressure
DOOM measures volatility contraction, loading, expansion, and late‑phase blowoff.
- Low DOOM = quiet tape
- Rising DOOM = pressure
- High DOOM = instability or overextension
4. Ladders — Timing the Turn
The ladders narrate how a move ages (Exhaustion Ladder) or how a down‑move stabilizes and transitions (Reversal Ladder).
- Exhaustion Ladder: Fade → TP Zone → TP → Trail Stop
Shows when a trend is stretching, weakening, and preparing to fail. - Reversal Ladder: Recover → Rev Zone → Rev → Trend Rebuild
Shows when a down‑move is unwinding, stabilizing, and preparing for a new cycle.
5. Decision — Your System
Once you’ve read the environment, pressure, energy cycle, volatility pressure, and ladder state, then you make decisions using your own system.
Overwatch never tells you what to do.
It tells you what the environment is doing, so you can decide what to do.
AdaptiveTrend V13 + Overwatch: Institutional Footprint Detection
AdaptiveTrend V13 and Overwatch together form a two‑layer environment intelligence system:
- AdaptiveV13 reads trend mechanics, displacement, efficiency, and structural flow.
- Overwatch reads pressure, energy cycle, volatility state, and aging/reversal timing.
a real‑time map of institutional footprints—not by guessing motives, but by reading the environmental distortions that only large players can create.
1. Trend Mechanics Reveal Intent (AdaptiveV13)
Institutions leave footprints when they push price with size. AdaptiveV13 detects these through:
- Displacement — large, efficient pushes that break structure
- Trend Strength — when the engine stays elevated through pullbacks
- Efficiency Score — clean, low‑friction movement that only size can produce
- Risk/Zone/Setup — structural alignment that precedes institutional continuation
When the trend is strong, efficient, and directional, someone with size is pushing.
But trend alone can’t tell you whether the move is healthy, aging, or about to fail.
That’s where Overwatch steps in.
2. Pressure Exposes Structural Stress (Overwatch)
Pressure (P0–P4) shows whether the environment is supporting or resisting the move.
- P2 → directional pressure (institutions pressing)
- P3 → instability (institutions unloading or counter‑pressure entering)
- P4 → critical stress (trend failure, forced unwind)
3. MicroState Shows the Auction Cycle Institutions Create
Institutions don’t just move price—they move energy. MicroState reveals the cycle they leave behind:
Contracting → Coil → Expansion → Blowoff → Contracting
- Coil → Expansion = accumulation → markup
- Blowoff → Contracting = distribution → unwind
4. DOOM Shows Volatility Manipulation
Institutions manipulate volatility to create opportunity:
- Low DOOM → quiet tape, controlled environment (accumulation or markup)
- Rising DOOM → pressure building (institutional loading or trap setting)
- High DOOM → instability, blowoff, forced exits
5. Ladders Reveal the Exact Timing of Institutional Behavior
Exhaustion Ladder (top‑side)
Fade → TP Zone → TP → Trail Stop
Shows when institutions are exiting, distributing, or ending a campaign.
Reversal Ladder (bottom‑side)
Recover → Rev Zone → Rev → Trend Rebuild
Shows when institutions are absorbing, stabilizing, or starting a new campaign.
Footprint: Ladders show when institutions are aging a move or rebuilding one.
6. The Fusion: How AdaptiveV13 + Overwatch Expose Manipulator Footprints
A. When institutions push a trend
- AdaptiveV13: displacement + efficiency
- Overwatch: P2 + Coil → Expansion + low DOOM
Footprint: accumulation → markup → continuation.
- AdaptiveV13: displacement against structure
- Overwatch: P3 + rising DOOM + Blowoff
Footprint: engineered volatility spike → liquidity grab.
- AdaptiveV13: trend strength fading
- Overwatch: Fade → TP Zone → TP → Trail Stop
Footprint: distribution → exhaustion → unwind.
- AdaptiveV13: risk/zone alignment
- Overwatch: Recover → Rev Zone → Rev → Trend Rebuild
Footprint: absorption → stabilization → new trend ignition.
Institutions can hide their orders.
They can’t hide the environmental distortions those orders create.
- Trend mechanics
- Structural pressure
- Energy cycle
- Volatility compression/expansion
- Aging/reversal timing
Developer’s Note
This project began as a simple OB‑OS‑TP tool inspired by @Christopher84’s confirmation candles. What started as a small experiment quickly outgrew its original purpose. Within a few weeks of rapid iteration, testing, and refinement, it evolved into Overwatch—a full environment model that narrates structure, energy, volatility, and trend aging in real time.
Ruby:
# Assembled by ATCSAM — playing it forward 02/26/26
# Credits & Influences
# usethinkscript Community — collaboration, testing, and shared insight
# Christopher84 - Confirmation Candles Indicator For ThinkorSwim
# Just ANother Trader - Confirmed Contrarian For ThinkOrSwim
# Adeodatus - SPeedTrend (TrendQualityAnalyzer) For ThinkOrSwim
############################################
# Z‑STAR‑C DOOM MASTER ENGINE
############################################
declare upper;
input price = close;
input smaLength = 6;
input atrLength = 15;
input atrMult = 2.0;
input zCloudLevel = 1.6;
input showZCloud = yes;
input showLabels = yes;
input showInstitutionalExtreme = yes;
input LabelPos = {default "Bottom Right", "Top Left", "Top Right", "Bottom Left"};
def pos =
if LabelPos == LabelPos."Top Left" then 0 else
if LabelPos == LabelPos."Top Right" then 1 else
if LabelPos == LabelPos."Bottom Left" then 2 else
3;
############################################
# 1) STAR‑C STRUCTURAL BASELINE
############################################
def smaBase = Average(price, smaLength);
def atr = Average(TrueRange(high, close, low), atrLength);
def upperBand = smaBase + atrMult * atr;
def lowerBand = smaBase - atrMult * atr;
############################################
# 2) Z‑SCORE ENGINE (ADAPTIVE)
############################################
def zMean50 = Average(price, 50);
def zDev50 = StDev(price, 50);
def z50 = if zDev50 != 0 then (price - zMean50) / zDev50 else 0;
def zMean30 = Average(price, 30);
def zDev30 = StDev(price, 30);
def z30 = if zDev30 != 0 then (price - zMean30) / zDev30 else 0;
def zMean20 = Average(price, 20);
def zDev20 = StDev(price, 20);
def z20 = if zDev20 != 0 then (price - zMean20) / zDev20 else 0;
def zMean10 = Average(price, 10);
def zDev10 = StDev(price, 10);
def z10 = if zDev10 != 0 then (price - zMean10) / zDev10 else 0;
def zScore =
if AbsValue(z50) > 3 then z10 else
if AbsValue(z50) > 2 then z20 else
if AbsValue(z50) > 1.5 then z30 else
z50;
def zSlope = zScore - zScore[1];
def z2Mean = Average(zScore, 20);
def z2Dev = StDev(zScore, 20);
def z2 = if z2Dev != 0 then (zScore - z2Mean) / z2Dev else 0;
############################################
# 3) CURVED, VOLATILITY‑AWARE DOME
############################################
def zStretch = Max(0, AbsValue(zScore) - zCloudLevel);
def zCurve = Power(zStretch, 1.5);
def atrMean = Average(atr, 20);
def volWeight = if atrMean != 0 then atr / atrMean else 1;
def zExpandRaw = zCurve * atr * volWeight;
def zExpand = ExpAverage(zExpandRaw, 3);
############################################
# 4) Z‑STAR‑C DOMES (CLOUDS)
############################################
AddCloud(
if showZCloud and zScore > zCloudLevel then upperBand + zExpand else Double.NaN,
if showZCloud and zScore > zCloudLevel then upperBand else Double.NaN,
Color.CYAN, Color.CURRENT
);
AddCloud(
if showZCloud and zScore < -zCloudLevel then lowerBand else Double.NaN,
if showZCloud and zScore < -zCloudLevel then lowerBand - zExpand else Double.NaN,
Color.Light_GREEN, Color.CURRENT
);
############################################
# STAR‑C / KELTNER TAKE‑PROFIT
############################################
input showStarcTPCloud = no;
def IntermResistance = Highest(price, 75);
def IntermSupport = Lowest(price, 75);
def valS = Average(price, 6);
def average_true_range =
if atrLength == 15 then atr
else Average(TrueRange(high, close, low), 15);
def Upper_BandS = valS + 1.25 * average_true_range;
def Lower_BandS = valS - 1.25 * average_true_range;
def shiftK2 = 3.25 * MovingAverage(AverageType.SIMPLE, TrueRange(high, close, low), 20);
def averageK2 = MovingAverage(AverageType.SIMPLE, price, 20);
def Upper_BandK2 = averageK2 + shiftK2;
def Lower_BandK2 = averageK2 - shiftK2;
def condition_BandRevDn = Upper_BandS > Upper_BandK2;
def condition_BandRevUp = Lower_BandS < Lower_BandK2;
AddCloud(
if showStarcTPCloud and condition_BandRevUp then Lower_BandK2 else Double.NaN,
if showStarcTPCloud then Lower_BandS else Double.NaN,
Color.LIGHT_GREEN, Color.CURRENT
);
AddCloud(
if showStarcTPCloud and condition_BandRevDn then Upper_BandS else Double.NaN,
if showStarcTPCloud then Upper_BandK2 else Double.NaN,
Color.RED, Color.CURRENT
);
############################################
# 6) INSTITUTIONAL EXTREME ENGINE
############################################
def StatExtreme =
zScore > zCloudLevel and
zSlope < 0 and
z2 < 0;
def StructExtreme =
high >= upperBand or
low <= lowerBand or
(close > upperBand and close[1] <= upperBand) or
(close < lowerBand and close[1] >= lowerBand);
def spread = high - low;
def avgSpread = Average(spread, 20);
def narrowSpread = spread < avgSpread * 0.7;
def wideSpread = spread > avgSpread * 1.3;
def avgVol = Average(volume, 20);
def highVolume = volume > avgVol * 1.5;
def effortNoResult =
wideSpread and highVolume and
AbsValue(close - open) < spread * 0.25;
def absorption = narrowSpread and highVolume;
def stoppingVolume =
highVolume and close < close[1] and high == high[1];
def FlowExtreme =
effortNoResult or absorption or stoppingVolume;
def trendMa = ExpAverage(price, 50);
def trendStrength = AbsValue(trendMa - trendMa[5]) / (trendMa[5] + 0.0001);
def TrendExtreme =
trendStrength > 0.01 or
close > upperBand or
close < lowerBand;
def InstitutionalExtreme =
StatExtreme and
StructExtreme and
FlowExtreme and
TrendExtreme;
AddLabel(showInstitutionalExtreme and InstitutionalExtreme,
"Institutional Extreme", Color.RED, pos
);
############################################
# 7) DEBUG Z LABEL
############################################
AddLabel(showLabels,
"Z: " + Round(zScore, 2),
if zScore > 0 then Color.GREEN else Color.RED,
pos
);
############################################
# 8) DOOM METER
############################################
def domeThickness = zExpand;
def domeSmooth = ExpAverage(domeThickness, 5);
def domeROC = domeSmooth - domeSmooth[3];
def domeNorm =
if HighestAll(domeSmooth) == LowestAll(domeSmooth)
then 0
else 100 * (domeSmooth - LowestAll(domeSmooth)) /
(HighestAll(domeSmooth) - LowestAll(domeSmooth));
def domeCompression = domeROC < 0;
def domeExpansion = domeROC > 0;
AddLabel(yes,
"DOOM: " + Round(domeNorm, 1) +
(if domeCompression then " (Contracting)"
else if domeExpansion then " (Expanding)"
else ""),
if domeNorm > 90 then Color.RED
else if domeNorm > 70 then Color.ORANGE
else if domeNorm > 50 then Color.YELLOW
else if domeNorm > 20 then Color.GREEN
else Color.CYAN,
pos
);
############## Trend Quality × Volatility ##############################
def doomRegime =
if domeCompression then 0
else if domeExpansion then 2
else 1;
input tq_source = close;
input tq_maxLen = 50;
input tq_accelMult = 5.0;
input tq_speedSmooth = 5;
input tq_normLookback = 100;
def tq_maxAbs = Highest(tq_source, 200);
def tq_norm = (tq_source + tq_maxAbs) / (2 * tq_maxAbs);
def tq_dynLen = 5 + tq_norm * (tq_maxLen - 5);
def tq_delta = AbsValue(tq_source - tq_source[1]);
def tq_maxDelta = Highest(tq_delta, 200);
def tq_safeMaxDelta = if tq_maxDelta == 0 then 1 else tq_maxDelta;
def tq_accelFactor = tq_delta / tq_safeMaxDelta;
def tq_alphaBase = 2 / (tq_dynLen + 1);
def tq_alphaRaw = tq_alphaBase * (1 + tq_accelFactor * tq_accelMult);
def tq_alpha = Min(1, tq_alphaRaw);
rec tq_dynEMA =
if BarNumber() == 1 then tq_source
else tq_alpha * tq_source + (1 - tq_alpha) * tq_dynEMA[1];
def tq_speed = tq_dynEMA - tq_dynEMA[1];
def tq_trendSpeed = HullMovingAvg(tq_speed, tq_speedSmooth);
def tq_trendSpeedSmooth = ExpAverage(tq_trendSpeed, 3);
def tq_trendQuality = tq_trendSpeedSmooth * tq_accelFactor;
def tq_min = Lowest(tq_trendQuality, tq_normLookback);
def tq_max = Highest(tq_trendQuality, tq_normLookback);
def tq_normQ_raw =
if tq_max == tq_min then 0
else (tq_trendQuality - tq_min) / (tq_max - tq_min);
def tq_normQ = Max(0, Min(1, tq_normQ_raw));
def tq_T0 = tq_normQ < 0.25;
def tq_T1 = tq_normQ >= 0.25 and tq_normQ < 0.50;
def tq_T2 = tq_normQ >= 0.50 and tq_normQ < 0.75;
def tq_T3 = tq_normQ >= 0.75;
def microTrend =
if tq_T3 then 3 else
if tq_T2 then 2 else
if tq_T1 then 1 else 0;
def tqVolHybrid = microTrend * doomRegime;
############################################
# 9) PRE‑EXTREME WARNING
############################################
def layerCount =
(if StatExtreme then 1 else 0) +
(if StructExtreme then 1 else 0) +
(if FlowExtreme then 1 else 0) +
(if TrendExtreme then 1 else 0);
def PreExtreme = layerCount == 3 and !InstitutionalExtreme;
AddLabel(showInstitutionalExtreme and PreExtreme,
"Pre‑Extreme Warning", Color.ORANGE, pos
);
############################################
# 10) MICRO‑DIAGNOSTICS
############################################
def zPhaseDown = zSlope < 0;
def volBurst = domeROC > domeSmooth * 0.15;
def rotRaw = (spread / avgSpread) * (volume / avgVol);
def rotNorm =
if HighestAll(rotRaw) == 0 then 0
else rotRaw / HighestAll(rotRaw);
def distUpper = upperBand - close;
def distLower = close - lowerBand;
def trendEnergy = trendMa - trendMa[2];
def trendDecel = trendEnergy < 0;
def ema3 = ExpAverage(close, 3);
def ema3Slope = ema3 - ema3[1];
def mom3 = close - close[3];
def upBodies =
(close > open) +
(close[1] > open[1]) +
(close[2] > open[2]);
def dnBodies =
(close < open) +
(close[1] < open[1]) +
(close[2] < open[2]);
def bullBias = ema3Slope > 0 and mom3 > 0 and upBodies >= 2;
def bearBias = ema3Slope < 0 and mom3 < 0 and dnBodies >= 2;
############################################
# 10b) DIRECTIONAL COMMITMENT & STABILITY (M3)
############################################
def barRange = high - low;
def bodySize = AbsValue(close - open);
def upperWick = high - Max(open, close);
def lowerWick = Min(open, close) - low;
def safeRange = if barRange == 0 then 0.0001 else barRange;
def bodyFrac = bodySize / safeRange;
def bullBar = close > open;
def bearBar = close < open;
def followThroughUp = bullBar and close > close[1];
def followThroughDown = bearBar and close < close[1];
def overlap =
(high <= high[1] and low >= low[1]) or
(high[1] <= high and low[1] >= low);
def wickAlignedBull = bullBar and lowerWick > upperWick;
def wickAlignedBear = bearBar and upperWick > lowerWick;
def dcRaw =
(if bodyFrac > 0.5 then 1 else 0) +
(if followThroughUp or followThroughDown then 1 else 0) +
(if wickAlignedBull or wickAlignedBear then 1 else 0) +
(if !overlap then 1 else 0);
def dcNorm = dcRaw / 4;
input dsLen = 5;
def dirBar = if close > open then 1 else if close < open then -1 else 0;
def dirSlope = if ema3Slope > 0 then 1 else if ema3Slope < 0 then -1 else 0;
def dirMom = if mom3 > 0 then 1 else if mom3 < 0 then -1 else 0;
def dirBarSum = Sum(dirBar, dsLen);
def dirSlopeSum = Sum(dirSlope, dsLen);
def dirMomSum = Sum(dirMom, dsLen);
def dsBar = AbsValue(dirBarSum) / dsLen;
def dsSlope = AbsValue(dirSlopeSum) / dsLen;
def dsMom = AbsValue(dirMomSum) / dsLen;
def dsNormRaw = (dsBar + dsSlope + dsMom) / 3;
rec dcSmooth =
if IsNaN(dcSmooth[1]) then dcNorm
else dcSmooth[1] + 0.2 * (dcNorm - dcSmooth[1]);
rec dsSmooth =
if IsNaN(dsSmooth[1]) then dsNormRaw
else dsSmooth[1] + 0.2 * (dsNormRaw - dsSmooth[1]);
def dcNormH = Max(0, Min(1, dcSmooth));
def dsNorm = Max(0, Min(1, dsSmooth));
############################################
# 10b‑EXT) DOOM EXTENSION
############################################
def doomL_norm = domeNorm;
def doomL_compress = domeCompression;
def doomL_expand = domeExpansion;
def doomL_roc = domeROC;
def doomL_smooth = domeSmooth;
def doomL_squeeze =
doomL_compress and
doomL_norm > 10 and doomL_norm < 60 and
dsNorm >= 0.40 and
doomL_roc > doomL_smooth * -0.05 and
!volBurst;
def doomL_state =
if doomL_compress and !volBurst and dsNorm >= 0.5 then 0 else
if doomL_compress and volBurst then 1 else
if doomL_expand and !volBurst and dsNorm >= 0.5 then 2 else
if doomL_expand and volBurst then 3 else
0;
def microState = doomL_state;
############################################
# 11) EARLY TAKE PROFIT (TRIPLE‑CONFLICT + DC/DS + TQ×V + DOOM)
############################################
def priceCrossResistance =
high >= IntermResistance and
close < high;
def curveConflict = domeROC < 0;
def earlyCore_base =
zScore > 1.0 and
microState >= 1 and
(curveConflict or priceCrossResistance) and
zSlope > 0;
def earlyLate_base =
zSlope < 0 and zSlope[1] > 0 and
(curveConflict or priceCrossResistance) and
microState >= 1 and
zScore > 1.0;
def trendWeak = microTrend <= 1;
def volHostile = doomRegime == 2;
def envWeak = tqVolHybrid <= 2;
def commitWeak = dcNormH < 0.5;
def trendUnstable = dsNorm < 0.5;
def earlyCore =
earlyCore_base and
(trendWeak or envWeak or commitWeak or trendUnstable);
def earlyLate =
earlyLate_base and
!volHostile and
(commitWeak or trendUnstable);
def earlyTP = earlyCore or earlyLate;
############################################
# 11B) EARLY REVERSAL (BOTTOM‑SIDE MIRROR)
# (TRIPLE‑CONFLICT + DC/DS + TQ×V + DOOM)
############################################
# Price crosses into support zone and rejects
def priceCrossSupport =
low <= IntermSupport and
close > low;
# Dome curvature improvement (primary early tell)
def curveRecover = domeROC > 0;
# Base Early Reversal before upslope (unchanged core mirror)
def earlyRevCore_base =
zScore < -1.0 and
microState <= 2 and
(curveRecover or priceCrossSupport) and
zSlope < 0;
# Base Late Reversal immediately after upslope (mirror)
def earlyRevLate_base =
zSlope > 0 and zSlope[1] < 0 and
(curveRecover or priceCrossSupport) and
microState <= 2 and
zScore < -1.0;
# --- TQ×V context filters (mirrored) ---
def trendWeak_up = microTrend >= 3; # T3/T4 (weak downtrend)
def volSupportive = doomRegime == 0; # contracting vol
def envSupportive = tqVolHybrid >= 3; # supportive trend × vol
def commitStrong = dcNormH > 0.5; # improving commitment
def trendStable = dsNorm > 0.5; # improving stability
# Refined Early Core: fire earlier when trend/env are supportive
def earlyRevCore =
earlyRevCore_base and
(trendWeak_up or envSupportive or commitStrong or trendStable);
# Refined Early Late: avoid too-early reversal in hostile vol
def earlyRevLate =
earlyRevLate_base and
volSupportive and
(commitStrong or trendStable);
def earlyReversal = earlyRevCore or earlyRevLate;
############################################
# 12) MICRO‑STATE & PRESSURE LABELS
############################################
AddLabel(showLabels,
"MicroState: " +
(if microState == 0 then "Contracting"
else if microState == 1 then "Coiling"
else if microState == 2 then "Expansion"
else "Blowoff"),
if microState == 3 then Color.RED
else if microState == 2 then Color.ORANGE
else if microState == 1 then Color.YELLOW
else Color.CYAN,
pos
);
def microPressure =
(if domeCompression then 1 else 0) +
(if zPhaseDown then 1 else 0) +
(if rotNorm > 0.6 then 1 else 0) +
(if trendDecel then 1 else 0) +
(if dcNormH < 0.5 then 1 else 0) +
(if dsNorm < 0.5 then 1 else 0);
def pState =
if microPressure == 0 then 0 else
if microPressure == 1 then 1 else
if microPressure == 2 or microPressure == 3 then 2 else
if microPressure == 4 or microPressure == 5 then 3 else
4;
AddLabel(
yes,
"P" + pState,
if pState == 0 then Color.LIGHT_GRAY
else if pState == 1 then Color.YELLOW
else if pState == 2 and bullBias then CreateColor(150, 220, 150)
else if pState == 2 and bearBias then CreateColor(220, 150, 150)
else if pState == 3 then CreateColor(230, 180, 60)
else Color.RED,
pos
);
############################################
# 5) EXHAUSTION LADDER (FADE → TP‑ZONE → TP → TRAIL STOP)
############################################
def fadeSignal =
zScore > zCloudLevel and
zSlope[1] > 0 and zSlope < 0 and
close < upperBand + zExpand;
AddLabel(showLabels and fadeSignal, "Fade", Color.YELLOW, pos);
def tpZone =
earlyTP or
fadeSignal or
(zScore > 1.0 and microState == 0) or
(zScore > 1.0 and doomRegime == 1) or
(curveConflict and zScore > 1.0) or
priceCrossResistance;
AddLabel(showLabels and tpZone, "TP‑Zone", Color.YELLOW, pos);
def takeProfitSignal =
zScore > zCloudLevel and
z2[1] > 0 and z2 < 0 and
high >= upperBand;
AddLabel(showLabels and takeProfitSignal, "Take Profit", Color.MAGENTA, pos);
def trailStopSignal =
zScore > zCloudLevel and
zSlope < 0 and zSlope[1] < 0 and
close < upperBand;
AddLabel(showLabels and trailStopSignal, "Trail Stop", Color.CYAN, pos);
############################################
# 5B) REVERSAL LADDER (RECOVER → REV‑ZONE → REV → TREND REBUILD)
############################################
# 1) RECOVER — earliest curvature improvement (mirror of Fade)
def recoverSignal =
zScore < -zCloudLevel and
zSlope[1] < 0 and zSlope > 0 and
close > lowerBand - zExpand;
AddLabel(showLabels and recoverSignal, "Recover", Color.YELLOW, pos);
# 2) REV‑ZONE — early stabilization zone (mirror of TP‑Zone)
def revZone =
earlyReversal or
recoverSignal or
(zScore < -1.0 and microState == 3) or
(zScore < -1.0 and doomRegime == 1) or
(curveRecover and zScore < -1.0) or
priceCrossSupport;
AddLabel(showLabels and revZone, "Rev‑Zone", Color.YELLOW, pos);
# 3) REV — confirmed reversal impulse (mirror of Take Profit)
def revSignal =
zScore < -zCloudLevel and
z2[1] < 0 and z2 > 0 and
low <= lowerBand;
AddLabel(showLabels and revSignal, "Rev", Color.MAGENTA, pos);
# 4) TREND REBUILD — structural rebuild (mirror of Trail Stop)
def trendRebuildSignal =
zScore < -zCloudLevel and
zSlope > 0 and zSlope[1] > 0 and
close > lowerBand;
AddLabel(showLabels and trendRebuildSignal, "Trend Rebuild", Color.CYAN, pos);
Last edited by a moderator: