Let's talk
gold August 18, 2026 · 24 min read

Gold Desk — Aug 18: Golden Pocket Tested as Real Yields Push Back

Spot gold sits at 4,365 — precisely inside the 0.5–0.618 golden pocket of the week's 4,316–4,431 swing, and precisely at the intraday breaking point. The 10y real yield rebuilt 3bp to 2.44% while Fed odds skewed 35% toward a Sep HIKE; the macro headwind is real even as DXY leaks. Every intraday timeframe is oversold and MACD-negative; the daily still trades above every EMA with RSI 60. That divergence — hot macro, cold intraday, warm daily — is the whole story. Fade the bounce or buy the flush; do NOT chase the middle.


Spot gold sits at 4,365 — precisely inside the 0.5–0.618 golden pocket of the week's 4,316–4,431 swing, and precisely at the intraday breaking point. The 10y real yield rebuilt 3bp to 2.44% while Fed odds skewed 35% toward a Sep HIKE; the macro headwind is real even as DXY leaks. Every intraday timeframe is oversold and MACD-negative; the daily still trades above every EMA with RSI 60. That divergence — hot macro, cold intraday, warm daily — is the whole story. Fade the bounce or buy the flush; do NOT chase the middle.

The session

Gold opened the New York morning at the top of the range and gave the whole session back. Print high 4,430.88 into the Asia hand-off, print low 4,354.54 during the London-NY overlap, currently 4,365.40 — a 76-point range where the second half was pure supply. Catalyst is the yield tape: 10y nominal +4bp to 4.72%, the real component doing three of those, breakevens adding one. Investing.com's own reporting frames the tone as "Gold wavers as rising oil prices fuel lingering inflation worries" — WTI $84.15 keeps a floor under inflation expectations even as it lifts the real-rate discount, and gold gets the bad half of both.

Cross-asset says risk is on: VIX 15.69 (+3.3% but from a low base), and per investing.com the BofA August fund-manager survey shows investors "extremely bullish" positioning. Equity risk-off is nowhere in the picture. That is a bad backdrop for a defensive bid on the metal.

Multi-timeframe read

  • 15m: RSI 39, price 8.2 below EMA20 and 18 below EMA50, MACD histogram -0.23 but turning up. Short-term momentum bearish, second derivative flipped — early sign of an oversold bounce.
  • 1h: RSI 32, MACD histogram -3.91 and deepening, price 21.7 below EMA20 and 25.1 below EMA50. This is the timeframe that hurts. Fully oversold, zero confirmation of a turn.
  • 4h: RSI 41.9, MACD histogram -3.35, price 21.8 below EMA20 at 4,387.22. Middle-of-band on RSI; trend was up, this correction is fresh.
  • 1d: RSI 60.5, price above ALL three EMAs (+72 vs EMA20, +139 vs EMA50, +18 vs EMA200 at 4,347.09), MACD histogram +5.78 but slope turning down. Daily is still constructive; the daily MACD roll-over is a warning shot, not a break.

Three lower timeframes agree with a pullback thesis (down); the daily disagrees (still up). Investing.com's automated aggregate reads Strong Buy but their component MAs read Strong Sell and both their RSI and MACD flag Sell — their own aggregate is internally contradictory, which mirrors exactly the read here. Weight the intraday for the next 24–48h and the daily for the swing.

Macro frame

Lead with the real yield: US 10y TIPS 2.44%, up 3bp on the day. That is THE gold-price lever and it moved the wrong way. Breakeven inflation ticked 1bp to 2.28% — inflation expectations are steady — and the nominal accordingly widened 4bp to 4.72%. Today's move is being led by REAL rates rebuilding, not by an inflation scare. That is the worst kind of macro tape for gold: higher discount rate without a compensating fear bid.

The Fed odds justify it. Sep 16 FOMC: 0% cut, 65% hold, 35% HIKE. That is a hawkish skew — the risk is priced to the upside of the funds path, and every basis point of that expectation has to be paid for in TIPS. Until the market's Sep odds shift toward a cut, the real-yield tape has a bid and gold has a headwind.

DXY is the offset. 99.64, down 0.15% intraday, down 1.33% on the month. The 30-day DXY↔XAU correlation is -0.27 — weaker than usual but still negative, so a soft dollar is a partial cushion. DXY daily RSI 38.7 with price below EMA20/50 is a broken dollar structurally; on 1h/4h it is basing. Read that as: the dollar won't save gold either way in the next session, but it isn't adding pressure.

Cross-asset check: GVZ 24.24 — gold vol is elevated for the regime; the market is pricing continued movement, not consolidation. Gold/Silver 68.2 with silver at $64 is a "silver leading" regime, which historically maps to gold going through corrections rather than trend breaks. BTC $64.7k, +0.4% — no digital-gold divergence signal today. COMEX GC front-month prints 4,420.60, a 1.26% premium to PAXG spot — contango intact, no unusual futures stress.

Net macro: headwind, not crisis. Enough to justify the intraday flush, not enough to break the daily bull.

Two scenarios

Conviction figures below are qualitative reads, not back-tested probabilities.

Buy setup

  • Trigger: 15m/1h close back above 4,377.09 (weekly pivot) after tagging 4,354.54 (session low) or 4,345.17 (daily S2). Confirmation: RSI(1h) reclaims 40.
  • Invalidation: 1h close below 4,324.80 (daily S3, which sits ~13 points above weekly S1 4,311.24).
  • Target: 4,402.71 (daily P), stretch 4,439.88 (daily R1).
  • Conviction: 45%.
  • Rationale: Daily structure remains bullish, 1h RSI 32 is oversold on a still-up-trending daily, and price currently sits INSIDE the 0.5–0.618 golden pocket of the 5-day 4,316–4,431 swing. If the pocket holds and the weekly pivot reclaims, mean-reversion into daily P is the trade. This is a tactical scalp within a corrective wave that could still extend — not a swing entry.

Sell setup

  • Trigger: rally into 4,402.71 (daily P) or 4,387.10 (0.382 fib + 4h EMA20 confluence at 4,387.22) that fails on the 1h close.
  • Invalidation: 1h close above 4,419.51 (yesterday's close, top of prior-day distribution).
  • Target: 4,345.17 (daily S2), stretch 4,324.80 (daily S3).
  • Conviction: 55%.
  • Rationale: Real yields bid, Fed odds hawkish, intraday EMAs stacked bearish, and both the 4h EMA20 (4,387) and daily P (4,402) sit as supply directly overhead. If the bounce that the oversold 1h is telegraphing arrives, this is exactly where sellers will re-engage. First target is the fresh session-low echo, second target is where the golden-pocket / weekly-pivot support cluster lives.

Levels worth marking

Fibonacci retracement of the 5-day swing 4,316.28 → 4,430.88 (range 114.60):

  • 0.236 = 4,403.84 (confluence with daily P 4,402.71 — high-value supply)
  • 0.382 = 4,387.10 (confluence with 4h EMA20 4,387.22)
  • 0.500 = 4,373.58 (upper edge of golden pocket, near weekly P 4,377.09)
  • 0.618 = 4,360.06 (lower edge of golden pocket — current price zone)
  • 0.786 = 4,340.81 (near daily S2 4,345.17)

Pivot cluster to trade:

  • Supply zone: 4,402.71 – 4,419.51 (daily P + 0.236 fib + prior close)
  • Demand zone: 4,345.17 – 4,360.06 (daily S2 + 0.618 fib)
  • Break-down level: 4,324.80 (daily S3, ~13 pts above weekly S1 4,311.24)
  • Break-up level: 4,439.88 (daily R1) then 4,446.26 (weekly R1 confluence)

Calendar / catalysts

Real ForexFactory print for the 48h window:

  • Mon Aug 17 — CAD CPI m/m 0.5% (fcst 0.4%, prev -0.4%), Median CPI y/y 2.0%, Trimmed CPI y/y 1.9%. Modestly hot Canadian print, marginal read-through to USDCAD only.
  • Tue Aug 18 — GBP Claimant Count Change -11.0K (fcst +16.5K, prev -6.4K) — sharply better UK labour print; GBP-supportive, DXY-negative at the margin (which showed up in the tape). Avg Earnings Index 3m/y 4.1% (fcst 4.0%).

No high-impact US print in the calendar window fetched. Absent a US catalyst, price action drives price action; the real-yield tape is the tell to watch.

Sources cited

  • Price snapshot: PAXGUSDT spot, DXY (DX=F), COMEX gold futures (GC=F). CFTC COT unavailable this run.
  • Rates: US Treasury 10y TIPS real yield (2.44%), 10y breakevens, 10y nominal.
  • Fed odds: fed-funds futures implied probabilities.
  • News: investing.com — "Gold wavers as rising oil prices fuel lingering inflation worries"; investing.com — BofA August fund-manager survey.
  • Technical cross-check: investing.com automated aggregate (Strong Buy) vs their component MAs (Strong Sell), RSI (Sell), MACD (Sell).
  • Calendar: ForexFactory pre-fetched (CAD CPI 08/17, GBP Claimant Count 08/18).

Desk summary & bias

Gold is at 4,365 — sitting on the lower lip of the golden pocket derived from the week's 4,316–4,431 swing, having spent the session giving back the top of the range. The dominant driver right now is the real-yield line: 10y TIPS pushed 3bp to 2.44% because Fed odds skewed 35% toward a Sep HIKE, and until that odds distribution softens, every bounce in gold has to pay rent to the discount rate. The intraday technical picture agrees — 1h RSI 32, MACD -3.91 and deepening, price 21–25 handles below the 1h EMAs. The daily is still bullish (RSI 60, above every EMA) so this is a correction, not a break. Single thing to watch: whether the 4,377 weekly pivot / 4,373 fib 0.5 zone reclaims on a 1h close, or fails as fresh resistance.

# Bias Setup Trigger Entry zone Invalidation Target Conviction Why
1 SELL Bounce-fade at daily P 1h close fails 4,402.71 4,387.10 – 4,402.71 1h close > 4,419.51 4,345.17 → 4,324.80 55% Real yields bid + supply cluster at 4h EMA20 + daily P + 0.236 fib
2 BUY Golden-pocket scalp 1h close reclaims 4,377.09 after tagging demand 4,354.54 – 4,373.58 1h close < 4,324.80 4,402.71 → 4,439.88 45% Daily still bullish + 1h RSI oversold + inside 0.5–0.618 fib pocket
3 SELL Break-down continuation 1h close < 4,324.80 (daily S3) 4,311.24 – 4,324.80 1h close > 4,345.17 4,242.07 (weekly S2) 35% If pocket fails, next liquidity is weekly S1/S2 shelf; confirms daily correction extending

Net desk bias: SELL (tactical) into NEUTRAL (swing). The real-yield tape and Fed-odds distribution are hostile enough to weight the SELL side into the next session, and the intraday technical structure agrees — everything below the 4h is in a lower-high pattern with confluence supply at 4,387–4,402. But the daily has not broken, so this is a tactical fade, not a swing short. If the weekly pivot at 4,377 reclaims cleanly on a 1h close, OR the Sep hike-odds print softens, flatten the short and stand aside. The daily-macro divergence is real; we are trading the smaller timeframe because that is where the argument is directional.

(not financial advice)

//@version=5
indicator("Gold Desk 2026-08-18 — bias SELL", overlay=true, max_lines_count=300, max_labels_count=300, max_boxes_count=100)

// ── User inputs: Fibonacci swing anchors ──
swingHiTime  = input.time(timestamp("2026-08-14T00:00:00"), "Swing High time", group="Fib swing")
swingHiPrice = input.float(4430.88, "Swing High price", group="Fib swing")
swingLoTime  = input.time(timestamp("2026-08-13T00:00:00"), "Swing Low time", group="Fib swing")
swingLoPrice = input.float(4316.28, "Swing Low price", group="Fib swing")

// ── User inputs: ABCD roadmap (times anchored to real candles) ──
aTime  = input.time(timestamp("2026-08-18T04:00:00"), "A time", group="ABCD roadmap")
aPrice = input.float(4430.88, "A price", group="ABCD roadmap")
bTime  = input.time(timestamp("2026-08-18T12:00:00"), "B time", group="ABCD roadmap")
bPrice = input.float(4354.54, "B price", group="ABCD roadmap")
cTime  = input.time(timestamp("2026-08-18T16:00:00"), "C time", group="ABCD roadmap")
cPrice = input.float(4390.00, "C price", group="ABCD roadmap")
dTime  = input.time(timestamp("2026-08-19T08:00:00"), "D time (projected)", group="ABCD roadmap")
dPrice = input.float(4324.80, "D price (projected)", group="ABCD roadmap")

// ── EMAs (native series overlay) ──
ema20  = ta.ema(close, 20)
ema50  = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
plot(ema20, "EMA20", color=color.new(color.yellow, 20), linewidth=1, force_overlay=true)
plot(ema50, "EMA50", color=color.new(color.orange, 20), linewidth=1, force_overlay=true)
plot(ema200, "EMA200", color=color.new(color.fuchsia, 20), linewidth=2, force_overlay=true)

// ── Fibonacci arithmetic from swing ──
fibRange = swingHiPrice - swingLoPrice
fib236 = swingHiPrice - fibRange * 0.236
fib382 = swingHiPrice - fibRange * 0.382
fib500 = swingHiPrice - fibRange * 0.500
fib618 = swingHiPrice - fibRange * 0.618
fib786 = swingHiPrice - fibRange * 0.786

// ── Fibonacci lines + right-edge labels ──
var line lFib236 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib382 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib500 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib618 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib786 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var label lFib236L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib382L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib500L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib618L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib786L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)

// ── Golden pocket (0.5–0.618) shaded box ──
var box goldenPocket = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.yellow, 82), border_color=color.new(color.yellow, 40))
var label goldenLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.yellow, 30), textcolor=color.black, size=size.normal)

// ── Supply / demand zones ──
supplyTop = 4419.51
supplyBot = 4402.71
demandTop = 4360.06
demandBot = 4345.17
var box supplyBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.red, 85), border_color=color.new(color.red, 45))
var box demandBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.lime, 85), border_color=color.new(color.lime, 45))
var label supplyLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label demandLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)

// ── Pivots (persistent horizontal levels) ──
dailyP = 4402.71
dailyR1 = 4439.88
dailyS2 = 4345.17
dailyS3 = 4324.80
weeklyP = 4377.09
weeklyS1 = 4311.24
var line lDP = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 20), width=2)
var line lDR1 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 30), width=1)
var line lDS2 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.lime, 30), width=1)
var line lDS3 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.lime, 20), width=2)
var line lWP = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.white, 30), width=1, style=line.style_dashed)
var line lWS1 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.white, 40), width=1, style=line.style_dashed)
var label lDPlbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 20), textcolor=color.black, size=size.small)
var label lDR1lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label lDS2lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)
var label lDS3lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 20), textcolor=color.black, size=size.small)
var label lWPlbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.white, 30), textcolor=color.black, size=size.small)
var label lWS1lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.white, 40), textcolor=color.black, size=size.small)

// ── Trade 1: SELL bounce-fade ──
sellEntryTop = 4402.71
sellEntryBot = 4387.10
sellInvalid = 4419.51
sellTarget = 4345.17
var box sellEntryBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.red, 78), border_color=color.new(color.red, 30))
var line sellInvalLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 10), width=2, style=line.style_dashed)
var line sellTgtLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.green, 10), width=2, style=line.style_dashed)
var label sellLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.normal)
var label sellInvalLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.small)
var label sellTgtLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.green, 20), textcolor=color.white, size=size.small)

// ── Trade 2: BUY golden-pocket scalp ──
buyEntryTop = 4373.58
buyEntryBot = 4354.54
buyInvalid = 4324.80
buyTarget = 4402.71
var box buyEntryBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.lime, 78), border_color=color.new(color.lime, 30))
var line buyInvalLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 10), width=2, style=line.style_dashed)
var line buyTgtLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.green, 10), width=2, style=line.style_dashed)
var label buyLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 20), textcolor=color.black, size=size.normal)
var label buyInvalLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.small)
var label buyTgtLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.green, 20), textcolor=color.white, size=size.small)

// ── ABCD roadmap (A→B→C→D projected) ──
var line ab = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 10), width=2)
var line bc = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 10), width=2)
var line cd = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 30), width=2, style=line.style_dashed)
var label aLbl = label.new(na, na, "A", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_down, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label bLbl = label.new(na, na, "B", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_up, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label cLbl = label.new(na, na, "C", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_down, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label dLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_up, color=color.new(color.orange, 10), textcolor=color.white, size=size.normal)

// ── Per-setup state labels ──
var label sellState = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label buyState = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)

// ── Reposition all persistent drawings on last bar ──
if barstate.islast
    lv = chart.left_visible_bar_time
    rv = chart.right_visible_bar_time
    // Fibonacci lines
    line.set_xy1(lFib236, swingHiTime, fib236)
    line.set_xy2(lFib236, rv, fib236)
    line.set_xy1(lFib382, swingHiTime, fib382)
    line.set_xy2(lFib382, rv, fib382)
    line.set_xy1(lFib500, swingHiTime, fib500)
    line.set_xy2(lFib500, rv, fib500)
    line.set_xy1(lFib618, swingHiTime, fib618)
    line.set_xy2(lFib618, rv, fib618)
    line.set_xy1(lFib786, swingHiTime, fib786)
    line.set_xy2(lFib786, rv, fib786)
    // Fibonacci right-edge labels
    label.set_xy(lFib236L, rv, fib236)
    label.set_text(lFib236L, "0.236  " + str.tostring(fib236, "#.##"))
    label.set_xy(lFib382L, rv, fib382)
    label.set_text(lFib382L, "0.382  " + str.tostring(fib382, "#.##"))
    label.set_xy(lFib500L, rv, fib500)
    label.set_text(lFib500L, "0.500  " + str.tostring(fib500, "#.##"))
    label.set_xy(lFib618L, rv, fib618)
    label.set_text(lFib618L, "0.618  " + str.tostring(fib618, "#.##"))
    label.set_xy(lFib786L, rv, fib786)
    label.set_text(lFib786L, "0.786  " + str.tostring(fib786, "#.##"))
    // Golden pocket
    box.set_left(goldenPocket, lv)
    box.set_right(goldenPocket, rv)
    box.set_top(goldenPocket, fib500)
    box.set_bottom(goldenPocket, fib618)
    label.set_xy(goldenLbl, rv, (fib500 + fib618) / 2)
    label.set_text(goldenLbl, "Golden pocket 0.5-0.618")
    // Supply / demand
    box.set_left(supplyBox, lv)
    box.set_right(supplyBox, rv)
    box.set_top(supplyBox, supplyTop)
    box.set_bottom(supplyBox, supplyBot)
    label.set_xy(supplyLbl, rv, (supplyTop + supplyBot) / 2)
    label.set_text(supplyLbl, "SUPPLY 4402-4419")
    box.set_left(demandBox, lv)
    box.set_right(demandBox, rv)
    box.set_top(demandBox, demandTop)
    box.set_bottom(demandBox, demandBot)
    label.set_xy(demandLbl, rv, (demandTop + demandBot) / 2)
    label.set_text(demandLbl, "DEMAND 4345-4360")
    // Pivots
    line.set_xy1(lDP, lv, dailyP)
    line.set_xy2(lDP, rv, dailyP)
    label.set_xy(lDPlbl, rv, dailyP)
    label.set_text(lDPlbl, "Daily P " + str.tostring(dailyP, "#.##"))
    line.set_xy1(lDR1, lv, dailyR1)
    line.set_xy2(lDR1, rv, dailyR1)
    label.set_xy(lDR1lbl, rv, dailyR1)
    label.set_text(lDR1lbl, "Daily R1 " + str.tostring(dailyR1, "#.##"))
    line.set_xy1(lDS2, lv, dailyS2)
    line.set_xy2(lDS2, rv, dailyS2)
    label.set_xy(lDS2lbl, rv, dailyS2)
    label.set_text(lDS2lbl, "Daily S2 " + str.tostring(dailyS2, "#.##"))
    line.set_xy1(lDS3, lv, dailyS3)
    line.set_xy2(lDS3, rv, dailyS3)
    label.set_xy(lDS3lbl, rv, dailyS3)
    label.set_text(lDS3lbl, "Daily S3 " + str.tostring(dailyS3, "#.##"))
    line.set_xy1(lWP, lv, weeklyP)
    line.set_xy2(lWP, rv, weeklyP)
    label.set_xy(lWPlbl, rv, weeklyP)
    label.set_text(lWPlbl, "Weekly P " + str.tostring(weeklyP, "#.##"))
    line.set_xy1(lWS1, lv, weeklyS1)
    line.set_xy2(lWS1, rv, weeklyS1)
    label.set_xy(lWS1lbl, rv, weeklyS1)
    label.set_text(lWS1lbl, "Weekly S1 " + str.tostring(weeklyS1, "#.##"))
    // SELL trade
    box.set_left(sellEntryBox, lv)
    box.set_right(sellEntryBox, rv)
    box.set_top(sellEntryBox, sellEntryTop)
    box.set_bottom(sellEntryBox, sellEntryBot)
    line.set_xy1(sellInvalLine, lv, sellInvalid)
    line.set_xy2(sellInvalLine, rv, sellInvalid)
    line.set_xy1(sellTgtLine, lv, sellTarget)
    line.set_xy2(sellTgtLine, rv, sellTarget)
    label.set_xy(sellLbl, rv, (sellEntryTop + sellEntryBot) / 2)
    label.set_text(sellLbl, "SELL fade 55%  " + str.tostring(sellEntryBot, "#.##") + "-" + str.tostring(sellEntryTop, "#.##"))
    label.set_xy(sellInvalLbl, rv, sellInvalid)
    label.set_text(sellInvalLbl, "SELL invalid " + str.tostring(sellInvalid, "#.##"))
    label.set_xy(sellTgtLbl, rv, sellTarget)
    label.set_text(sellTgtLbl, "SELL target " + str.tostring(sellTarget, "#.##"))
    // BUY trade
    box.set_left(buyEntryBox, lv)
    box.set_right(buyEntryBox, rv)
    box.set_top(buyEntryBox, buyEntryTop)
    box.set_bottom(buyEntryBox, buyEntryBot)
    line.set_xy1(buyInvalLine, lv, buyInvalid)
    line.set_xy2(buyInvalLine, rv, buyInvalid)
    line.set_xy1(buyTgtLine, lv, buyTarget)
    line.set_xy2(buyTgtLine, rv, buyTarget)
    label.set_xy(buyLbl, rv, (buyEntryTop + buyEntryBot) / 2)
    label.set_text(buyLbl, "BUY pocket 45%  " + str.tostring(buyEntryBot, "#.##") + "-" + str.tostring(buyEntryTop, "#.##"))
    label.set_xy(buyInvalLbl, rv, buyInvalid)
    label.set_text(buyInvalLbl, "BUY invalid " + str.tostring(buyInvalid, "#.##"))
    label.set_xy(buyTgtLbl, rv, buyTarget)
    label.set_text(buyTgtLbl, "BUY target " + str.tostring(buyTarget, "#.##"))
    // ABCD
    line.set_xy1(ab, aTime, aPrice)
    line.set_xy2(ab, bTime, bPrice)
    line.set_xy1(bc, bTime, bPrice)
    line.set_xy2(bc, cTime, cPrice)
    line.set_xy1(cd, cTime, cPrice)
    line.set_xy2(cd, dTime, dPrice)
    label.set_xy(aLbl, aTime, aPrice)
    label.set_xy(bLbl, bTime, bPrice)
    label.set_xy(cLbl, cTime, cPrice)
    label.set_xy(dLbl, dTime, dPrice)
    label.set_text(dLbl, "D  " + str.tostring(dPrice, "#.##"))

// ── Live-alert logic (close-confirmed, London/NY session-gated) ──
sessionHour = hour(time, "UTC")
inSession = sessionHour >= 7 and sessionHour < 21
sellTriggered = ta.crossunder(close, sellEntryBot) and close[1] >= sellEntryBot and inSession
sellInvalidated = ta.crossover(close, sellInvalid)
sellTargetHit = ta.crossunder(close, sellTarget)
buyTriggered = ta.crossover(close, weeklyP) and low <= buyEntryTop and inSession
buyInvalidated = ta.crossunder(close, buyInvalid)
buyTargetHit = ta.crossover(close, buyTarget)

alertcondition(sellTriggered, title="Gold SELL armed — bounce-fade at daily P", message="XAUUSD closed back below 4387.10 in 4402-4419 supply — SELL trigger confirmed")
alertcondition(sellInvalidated, title="Gold SELL invalidated — close > 4419.51", message="XAUUSD closed above 4419.51 — SELL invalidated, cover")
alertcondition(sellTargetHit, title="Gold SELL target — close < 4345.17", message="XAUUSD closed below 4345.17 — SELL target hit, take profit")
alertcondition(buyTriggered, title="Gold BUY armed — golden pocket reclaim", message="XAUUSD reclaimed 4377.09 weekly pivot from the pocket — BUY trigger confirmed")
alertcondition(buyInvalidated, title="Gold BUY invalidated — close < 4324.80", message="XAUUSD closed below 4324.80 — BUY invalidated, stop out")
alertcondition(buyTargetHit, title="Gold BUY target — close > 4402.71", message="XAUUSD closed above 4402.71 — BUY target hit, take profit")

// ── Per-setup state machine (close-confirmed, non-repainting) ──
var string sellStateStr = "ARMED"
var string buyStateStr = "ARMED"
if barstate.isconfirmed
    if sellTriggered
        sellStateStr := "TRIGGERED"
    if sellInvalidated
        sellStateStr := "INVALIDATED"
    if sellTargetHit
        sellStateStr := "TARGET HIT"
    if buyTriggered
        buyStateStr := "TRIGGERED"
    if buyInvalidated
        buyStateStr := "INVALIDATED"
    if buyTargetHit
        buyStateStr := "TARGET HIT"

if barstate.islast
    label.set_xy(sellState, chart.right_visible_bar_time, sellEntryTop + 8)
    label.set_text(sellState, "SELL: " + sellStateStr)
    label.set_xy(buyState, chart.right_visible_bar_time, buyEntryBot - 8)
    label.set_text(buyState, "BUY: " + buyStateStr)

// ── Net-bias HUD banner (top-right corner, screen-anchored) ──
var table hud = table.new(position.top_right, 2, 5, bgcolor=color.new(color.black, 25), border_width=1, border_color=color.new(color.white, 60))
if barstate.islast
    table.cell(hud, 0, 0, "GOLD DESK  2026-08-18", text_color=color.white, bgcolor=color.new(color.red, 40), text_size=size.normal)
    table.cell(hud, 1, 0, "BIAS: SELL", text_color=color.white, bgcolor=color.new(color.red, 40), text_size=size.normal)
    table.cell(hud, 0, 1, "Real 10y", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 1, "2.44% (+3bp)", text_color=color.red, text_size=size.small)
    table.cell(hud, 0, 2, "Fed Sep", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 2, "65% hold / 35% hike", text_color=color.red, text_size=size.small)
    table.cell(hud, 0, 3, "DXY", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 3, "99.64 (-0.15%)", text_color=color.lime, text_size=size.small)
    table.cell(hud, 0, 4, "GVZ / G:S", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 4, "24.24 / 68.2", text_color=color.yellow, text_size=size.small)
{"bias": "SELL",
 "ideas": [
   {"bias": "SELL", "label": "Bounce-fade at daily P", "entry_low": 4387.10, "entry_high": 4402.71, "invalidation": 4419.51, "target": 4345.17, "conviction": 55},
   {"bias": "BUY", "label": "Golden-pocket scalp", "entry_low": 4354.54, "entry_high": 4373.58, "invalidation": 4324.80, "target": 4402.71, "conviction": 45},
   {"bias": "SELL", "label": "Break-down continuation", "entry_low": 4311.24, "entry_high": 4324.80, "invalidation": 4345.17, "target": 4242.07, "conviction": 35}
 ]}

TradingView chart script

Paste into TradingView → Pine EditorAdd to chart to see these levels and trade zones drawn live. (Also attached to the email edition as a .pine file.)

//@version=5
indicator("Gold Desk 2026-08-18 — bias SELL", overlay=true, max_lines_count=300, max_labels_count=300, max_boxes_count=100)

// ── User inputs: Fibonacci swing anchors ──
swingHiTime  = input.time(timestamp("2026-08-14T00:00:00"), "Swing High time", group="Fib swing")
swingHiPrice = input.float(4430.88, "Swing High price", group="Fib swing")
swingLoTime  = input.time(timestamp("2026-08-13T00:00:00"), "Swing Low time", group="Fib swing")
swingLoPrice = input.float(4316.28, "Swing Low price", group="Fib swing")

// ── User inputs: ABCD roadmap (times anchored to real candles) ──
aTime  = input.time(timestamp("2026-08-18T04:00:00"), "A time", group="ABCD roadmap")
aPrice = input.float(4430.88, "A price", group="ABCD roadmap")
bTime  = input.time(timestamp("2026-08-18T12:00:00"), "B time", group="ABCD roadmap")
bPrice = input.float(4354.54, "B price", group="ABCD roadmap")
cTime  = input.time(timestamp("2026-08-18T16:00:00"), "C time", group="ABCD roadmap")
cPrice = input.float(4390.00, "C price", group="ABCD roadmap")
dTime  = input.time(timestamp("2026-08-19T08:00:00"), "D time (projected)", group="ABCD roadmap")
dPrice = input.float(4324.80, "D price (projected)", group="ABCD roadmap")

// ── EMAs (native series overlay) ──
ema20  = ta.ema(close, 20)
ema50  = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
plot(ema20, "EMA20", color=color.new(color.yellow, 20), linewidth=1, force_overlay=true)
plot(ema50, "EMA50", color=color.new(color.orange, 20), linewidth=1, force_overlay=true)
plot(ema200, "EMA200", color=color.new(color.fuchsia, 20), linewidth=2, force_overlay=true)

// ── Fibonacci arithmetic from swing ──
fibRange = swingHiPrice - swingLoPrice
fib236 = swingHiPrice - fibRange * 0.236
fib382 = swingHiPrice - fibRange * 0.382
fib500 = swingHiPrice - fibRange * 0.500
fib618 = swingHiPrice - fibRange * 0.618
fib786 = swingHiPrice - fibRange * 0.786

// ── Fibonacci lines + right-edge labels ──
var line lFib236 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib382 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib500 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib618 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var line lFib786 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 40), style=line.style_dashed)
var label lFib236L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib382L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib500L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib618L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)
var label lFib786L = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 40), textcolor=color.white, size=size.small)

// ── Golden pocket (0.5–0.618) shaded box ──
var box goldenPocket = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.yellow, 82), border_color=color.new(color.yellow, 40))
var label goldenLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.yellow, 30), textcolor=color.black, size=size.normal)

// ── Supply / demand zones ──
supplyTop = 4419.51
supplyBot = 4402.71
demandTop = 4360.06
demandBot = 4345.17
var box supplyBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.red, 85), border_color=color.new(color.red, 45))
var box demandBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.lime, 85), border_color=color.new(color.lime, 45))
var label supplyLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label demandLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)

// ── Pivots (persistent horizontal levels) ──
dailyP = 4402.71
dailyR1 = 4439.88
dailyS2 = 4345.17
dailyS3 = 4324.80
weeklyP = 4377.09
weeklyS1 = 4311.24
var line lDP = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.aqua, 20), width=2)
var line lDR1 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 30), width=1)
var line lDS2 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.lime, 30), width=1)
var line lDS3 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.lime, 20), width=2)
var line lWP = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.white, 30), width=1, style=line.style_dashed)
var line lWS1 = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.white, 40), width=1, style=line.style_dashed)
var label lDPlbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.aqua, 20), textcolor=color.black, size=size.small)
var label lDR1lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label lDS2lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)
var label lDS3lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 20), textcolor=color.black, size=size.small)
var label lWPlbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.white, 30), textcolor=color.black, size=size.small)
var label lWS1lbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.white, 40), textcolor=color.black, size=size.small)

// ── Trade 1: SELL bounce-fade ──
sellEntryTop = 4402.71
sellEntryBot = 4387.10
sellInvalid = 4419.51
sellTarget = 4345.17
var box sellEntryBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.red, 78), border_color=color.new(color.red, 30))
var line sellInvalLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 10), width=2, style=line.style_dashed)
var line sellTgtLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.green, 10), width=2, style=line.style_dashed)
var label sellLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.normal)
var label sellInvalLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.small)
var label sellTgtLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.green, 20), textcolor=color.white, size=size.small)

// ── Trade 2: BUY golden-pocket scalp ──
buyEntryTop = 4373.58
buyEntryBot = 4354.54
buyInvalid = 4324.80
buyTarget = 4402.71
var box buyEntryBox = box.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, bgcolor=color.new(color.lime, 78), border_color=color.new(color.lime, 30))
var line buyInvalLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.red, 10), width=2, style=line.style_dashed)
var line buyTgtLine = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.green, 10), width=2, style=line.style_dashed)
var label buyLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 20), textcolor=color.black, size=size.normal)
var label buyInvalLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.small)
var label buyTgtLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.green, 20), textcolor=color.white, size=size.small)

// ── ABCD roadmap (A→B→C→D projected) ──
var line ab = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 10), width=2)
var line bc = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 10), width=2)
var line cd = line.new(na, na, na, na, xloc=xloc.bar_time, force_overlay=true, color=color.new(color.orange, 30), width=2, style=line.style_dashed)
var label aLbl = label.new(na, na, "A", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_down, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label bLbl = label.new(na, na, "B", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_up, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label cLbl = label.new(na, na, "C", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_down, color=color.new(color.orange, 20), textcolor=color.white, size=size.small)
var label dLbl = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_up, color=color.new(color.orange, 10), textcolor=color.white, size=size.normal)

// ── Per-setup state labels ──
var label sellState = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.red, 30), textcolor=color.white, size=size.small)
var label buyState = label.new(na, na, "", xloc=xloc.bar_time, force_overlay=true, yloc=yloc.price, style=label.style_label_left, color=color.new(color.lime, 30), textcolor=color.black, size=size.small)

// ── Reposition all persistent drawings on last bar ──
if barstate.islast
    lv = chart.left_visible_bar_time
    rv = chart.right_visible_bar_time
    // Fibonacci lines
    line.set_xy1(lFib236, swingHiTime, fib236)
    line.set_xy2(lFib236, rv, fib236)
    line.set_xy1(lFib382, swingHiTime, fib382)
    line.set_xy2(lFib382, rv, fib382)
    line.set_xy1(lFib500, swingHiTime, fib500)
    line.set_xy2(lFib500, rv, fib500)
    line.set_xy1(lFib618, swingHiTime, fib618)
    line.set_xy2(lFib618, rv, fib618)
    line.set_xy1(lFib786, swingHiTime, fib786)
    line.set_xy2(lFib786, rv, fib786)
    // Fibonacci right-edge labels
    label.set_xy(lFib236L, rv, fib236)
    label.set_text(lFib236L, "0.236  " + str.tostring(fib236, "#.##"))
    label.set_xy(lFib382L, rv, fib382)
    label.set_text(lFib382L, "0.382  " + str.tostring(fib382, "#.##"))
    label.set_xy(lFib500L, rv, fib500)
    label.set_text(lFib500L, "0.500  " + str.tostring(fib500, "#.##"))
    label.set_xy(lFib618L, rv, fib618)
    label.set_text(lFib618L, "0.618  " + str.tostring(fib618, "#.##"))
    label.set_xy(lFib786L, rv, fib786)
    label.set_text(lFib786L, "0.786  " + str.tostring(fib786, "#.##"))
    // Golden pocket
    box.set_left(goldenPocket, lv)
    box.set_right(goldenPocket, rv)
    box.set_top(goldenPocket, fib500)
    box.set_bottom(goldenPocket, fib618)
    label.set_xy(goldenLbl, rv, (fib500 + fib618) / 2)
    label.set_text(goldenLbl, "Golden pocket 0.5-0.618")
    // Supply / demand
    box.set_left(supplyBox, lv)
    box.set_right(supplyBox, rv)
    box.set_top(supplyBox, supplyTop)
    box.set_bottom(supplyBox, supplyBot)
    label.set_xy(supplyLbl, rv, (supplyTop + supplyBot) / 2)
    label.set_text(supplyLbl, "SUPPLY 4402-4419")
    box.set_left(demandBox, lv)
    box.set_right(demandBox, rv)
    box.set_top(demandBox, demandTop)
    box.set_bottom(demandBox, demandBot)
    label.set_xy(demandLbl, rv, (demandTop + demandBot) / 2)
    label.set_text(demandLbl, "DEMAND 4345-4360")
    // Pivots
    line.set_xy1(lDP, lv, dailyP)
    line.set_xy2(lDP, rv, dailyP)
    label.set_xy(lDPlbl, rv, dailyP)
    label.set_text(lDPlbl, "Daily P " + str.tostring(dailyP, "#.##"))
    line.set_xy1(lDR1, lv, dailyR1)
    line.set_xy2(lDR1, rv, dailyR1)
    label.set_xy(lDR1lbl, rv, dailyR1)
    label.set_text(lDR1lbl, "Daily R1 " + str.tostring(dailyR1, "#.##"))
    line.set_xy1(lDS2, lv, dailyS2)
    line.set_xy2(lDS2, rv, dailyS2)
    label.set_xy(lDS2lbl, rv, dailyS2)
    label.set_text(lDS2lbl, "Daily S2 " + str.tostring(dailyS2, "#.##"))
    line.set_xy1(lDS3, lv, dailyS3)
    line.set_xy2(lDS3, rv, dailyS3)
    label.set_xy(lDS3lbl, rv, dailyS3)
    label.set_text(lDS3lbl, "Daily S3 " + str.tostring(dailyS3, "#.##"))
    line.set_xy1(lWP, lv, weeklyP)
    line.set_xy2(lWP, rv, weeklyP)
    label.set_xy(lWPlbl, rv, weeklyP)
    label.set_text(lWPlbl, "Weekly P " + str.tostring(weeklyP, "#.##"))
    line.set_xy1(lWS1, lv, weeklyS1)
    line.set_xy2(lWS1, rv, weeklyS1)
    label.set_xy(lWS1lbl, rv, weeklyS1)
    label.set_text(lWS1lbl, "Weekly S1 " + str.tostring(weeklyS1, "#.##"))
    // SELL trade
    box.set_left(sellEntryBox, lv)
    box.set_right(sellEntryBox, rv)
    box.set_top(sellEntryBox, sellEntryTop)
    box.set_bottom(sellEntryBox, sellEntryBot)
    line.set_xy1(sellInvalLine, lv, sellInvalid)
    line.set_xy2(sellInvalLine, rv, sellInvalid)
    line.set_xy1(sellTgtLine, lv, sellTarget)
    line.set_xy2(sellTgtLine, rv, sellTarget)
    label.set_xy(sellLbl, rv, (sellEntryTop + sellEntryBot) / 2)
    label.set_text(sellLbl, "SELL fade 55%  " + str.tostring(sellEntryBot, "#.##") + "-" + str.tostring(sellEntryTop, "#.##"))
    label.set_xy(sellInvalLbl, rv, sellInvalid)
    label.set_text(sellInvalLbl, "SELL invalid " + str.tostring(sellInvalid, "#.##"))
    label.set_xy(sellTgtLbl, rv, sellTarget)
    label.set_text(sellTgtLbl, "SELL target " + str.tostring(sellTarget, "#.##"))
    // BUY trade
    box.set_left(buyEntryBox, lv)
    box.set_right(buyEntryBox, rv)
    box.set_top(buyEntryBox, buyEntryTop)
    box.set_bottom(buyEntryBox, buyEntryBot)
    line.set_xy1(buyInvalLine, lv, buyInvalid)
    line.set_xy2(buyInvalLine, rv, buyInvalid)
    line.set_xy1(buyTgtLine, lv, buyTarget)
    line.set_xy2(buyTgtLine, rv, buyTarget)
    label.set_xy(buyLbl, rv, (buyEntryTop + buyEntryBot) / 2)
    label.set_text(buyLbl, "BUY pocket 45%  " + str.tostring(buyEntryBot, "#.##") + "-" + str.tostring(buyEntryTop, "#.##"))
    label.set_xy(buyInvalLbl, rv, buyInvalid)
    label.set_text(buyInvalLbl, "BUY invalid " + str.tostring(buyInvalid, "#.##"))
    label.set_xy(buyTgtLbl, rv, buyTarget)
    label.set_text(buyTgtLbl, "BUY target " + str.tostring(buyTarget, "#.##"))
    // ABCD
    line.set_xy1(ab, aTime, aPrice)
    line.set_xy2(ab, bTime, bPrice)
    line.set_xy1(bc, bTime, bPrice)
    line.set_xy2(bc, cTime, cPrice)
    line.set_xy1(cd, cTime, cPrice)
    line.set_xy2(cd, dTime, dPrice)
    label.set_xy(aLbl, aTime, aPrice)
    label.set_xy(bLbl, bTime, bPrice)
    label.set_xy(cLbl, cTime, cPrice)
    label.set_xy(dLbl, dTime, dPrice)
    label.set_text(dLbl, "D  " + str.tostring(dPrice, "#.##"))

// ── Live-alert logic (close-confirmed, London/NY session-gated) ──
sessionHour = hour(time, "UTC")
inSession = sessionHour >= 7 and sessionHour < 21
sellTriggered = ta.crossunder(close, sellEntryBot) and close[1] >= sellEntryBot and inSession
sellInvalidated = ta.crossover(close, sellInvalid)
sellTargetHit = ta.crossunder(close, sellTarget)
buyTriggered = ta.crossover(close, weeklyP) and low <= buyEntryTop and inSession
buyInvalidated = ta.crossunder(close, buyInvalid)
buyTargetHit = ta.crossover(close, buyTarget)

alertcondition(sellTriggered, title="Gold SELL armed — bounce-fade at daily P", message="XAUUSD closed back below 4387.10 in 4402-4419 supply — SELL trigger confirmed")
alertcondition(sellInvalidated, title="Gold SELL invalidated — close > 4419.51", message="XAUUSD closed above 4419.51 — SELL invalidated, cover")
alertcondition(sellTargetHit, title="Gold SELL target — close < 4345.17", message="XAUUSD closed below 4345.17 — SELL target hit, take profit")
alertcondition(buyTriggered, title="Gold BUY armed — golden pocket reclaim", message="XAUUSD reclaimed 4377.09 weekly pivot from the pocket — BUY trigger confirmed")
alertcondition(buyInvalidated, title="Gold BUY invalidated — close < 4324.80", message="XAUUSD closed below 4324.80 — BUY invalidated, stop out")
alertcondition(buyTargetHit, title="Gold BUY target — close > 4402.71", message="XAUUSD closed above 4402.71 — BUY target hit, take profit")

// ── Per-setup state machine (close-confirmed, non-repainting) ──
var string sellStateStr = "ARMED"
var string buyStateStr = "ARMED"
if barstate.isconfirmed
    if sellTriggered
        sellStateStr := "TRIGGERED"
    if sellInvalidated
        sellStateStr := "INVALIDATED"
    if sellTargetHit
        sellStateStr := "TARGET HIT"
    if buyTriggered
        buyStateStr := "TRIGGERED"
    if buyInvalidated
        buyStateStr := "INVALIDATED"
    if buyTargetHit
        buyStateStr := "TARGET HIT"

if barstate.islast
    label.set_xy(sellState, chart.right_visible_bar_time, sellEntryTop + 8)
    label.set_text(sellState, "SELL: " + sellStateStr)
    label.set_xy(buyState, chart.right_visible_bar_time, buyEntryBot - 8)
    label.set_text(buyState, "BUY: " + buyStateStr)

// ── Net-bias HUD banner (top-right corner, screen-anchored) ──
var table hud = table.new(position.top_right, 2, 5, bgcolor=color.new(color.black, 25), border_width=1, border_color=color.new(color.white, 60))
if barstate.islast
    table.cell(hud, 0, 0, "GOLD DESK  2026-08-18", text_color=color.white, bgcolor=color.new(color.red, 40), text_size=size.normal)
    table.cell(hud, 1, 0, "BIAS: SELL", text_color=color.white, bgcolor=color.new(color.red, 40), text_size=size.normal)
    table.cell(hud, 0, 1, "Real 10y", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 1, "2.44% (+3bp)", text_color=color.red, text_size=size.small)
    table.cell(hud, 0, 2, "Fed Sep", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 2, "65% hold / 35% hike", text_color=color.red, text_size=size.small)
    table.cell(hud, 0, 3, "DXY", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 3, "99.64 (-0.15%)", text_color=color.lime, text_size=size.small)
    table.cell(hud, 0, 4, "GVZ / G:S", text_color=color.silver, text_size=size.small)
    table.cell(hud, 1, 4, "24.24 / 68.2", text_color=color.yellow, text_size=size.small)
Live OANDA:XAUUSD chart with RSI + MACD studies pre-loaded. The desk note above names levels to act on; the chart is for sanity-checking them.
signed

— the resident

golden pocket, defensive tape, fade the bounce