PROTECTED SOURCE SCRIPT
Güncellendi GOLD – OB Clean + Internal/External Market Structure [Dragos]

GOLD – OB Clean + Internal/External Market Structure [Dragos]
All-in-one tool for XAUUSD that combines:
Clean Order Blocks (Supply/Demand) derived from the last opposite candle after a BOS (break of structure)
Internal & External Market Structure (CHoCH/BOS) with lines and labels
Visual zone management: right extension, mitigation (first touch), invalidation (close beyond), and 50% midline
How it works
Structure & BOS
Finds pivots (HH/LL) via Pivot len.
Triggers BOS when price crosses the last confirmed swing.
Order Blocks
On BOS, scans the last N bars for the opposite candle (bear for BOS up / bull for BOS down) and draws the OB:
Green = Demand, Red = Supply
Optional: use wicks (high/low) or just the body (open/close).
Mitigation: on first touch the zone fades or hides (per settings).
Invalidation: if price closes beyond the zone, it turns gray or gets removed (per settings).
Midline: 50% line for refined management (partial entries, R/R, etc.).
Internal / External Structure
Two structure layers: Internal (micro, shorter swing) and External (macro, longer swing).
Displays CHoCH/BOS with labels; External lines can be dashed for clarity.
Choose to show Internal, External, or Both.
Key Settings
Structure
Pivot len (swing HH/LL) — pivot sensitivity.
Order Blocks
Lookback N bars for the opposite candle
Use wicks — if on, zone uses high/low; otherwise just the body.
Zone Management
Extend zones to the right
Hide zone after mitigation (touch)
Fade zone after mitigation
Remove zone when invalidated
Show 50% line
Max zones stored
Colors: fill/border for Demand/Supply, 50% line color, Mitigated/Invalidated colors.
General
Only on XAU/GOLD (optional) — restricts execution to symbols containing “XAU”/“GOLD”.
Market Structure (tab)
Internal Swing Length / External Swing Length
Show Internal/External Market Structure (Both / Internal / External)
Colors for bullish/bearish MS
Usage Guide
Recommended timeframes: M5/M15 for entries, H1 for context.
Workflow:
Determine External (macro) direction.
Look for BOS and OB in the same direction on Internal.
Wait for mitigation (touch) inside the OB; the 50% line can be used for conservative entries.
Good confluences: sessions (killzones), volume spikes, extreme RSI, MAs (add as separate indicators if needed).
Visual Conventions
Demand: green; Supply: red.
Mitigated: faded yellow (or hidden if chosen).
Invalidated: gray (or removed).
50% line: gray.
Notes & Limits
Pine v6. Object caps follow TradingView limits (max_* = 500). On long histories, increase “Max zones stored” carefully.
BOS is computed when price crosses the last confirmed swing; some traders prefer “close-only” confirmation (can be customized if desired).
This tool does not auto-generate BUY/SELL signals; it’s a context & zones assistant.
Risk disclaimer: Trading involves risk. This tool is for educational analysis and does not guarantee profit. Use strict risk management (fixed SL, R:R ≥ 1:2, risk < 1% per trade).
All-in-one tool for XAUUSD that combines:
Clean Order Blocks (Supply/Demand) derived from the last opposite candle after a BOS (break of structure)
Internal & External Market Structure (CHoCH/BOS) with lines and labels
Visual zone management: right extension, mitigation (first touch), invalidation (close beyond), and 50% midline
How it works
Structure & BOS
Finds pivots (HH/LL) via Pivot len.
Triggers BOS when price crosses the last confirmed swing.
Order Blocks
On BOS, scans the last N bars for the opposite candle (bear for BOS up / bull for BOS down) and draws the OB:
Green = Demand, Red = Supply
Optional: use wicks (high/low) or just the body (open/close).
Mitigation: on first touch the zone fades or hides (per settings).
Invalidation: if price closes beyond the zone, it turns gray or gets removed (per settings).
Midline: 50% line for refined management (partial entries, R/R, etc.).
Internal / External Structure
Two structure layers: Internal (micro, shorter swing) and External (macro, longer swing).
Displays CHoCH/BOS with labels; External lines can be dashed for clarity.
Choose to show Internal, External, or Both.
Key Settings
Structure
Pivot len (swing HH/LL) — pivot sensitivity.
Order Blocks
Lookback N bars for the opposite candle
Use wicks — if on, zone uses high/low; otherwise just the body.
Zone Management
Extend zones to the right
Hide zone after mitigation (touch)
Fade zone after mitigation
Remove zone when invalidated
Show 50% line
Max zones stored
Colors: fill/border for Demand/Supply, 50% line color, Mitigated/Invalidated colors.
General
Only on XAU/GOLD (optional) — restricts execution to symbols containing “XAU”/“GOLD”.
Market Structure (tab)
Internal Swing Length / External Swing Length
Show Internal/External Market Structure (Both / Internal / External)
Colors for bullish/bearish MS
Usage Guide
Recommended timeframes: M5/M15 for entries, H1 for context.
Workflow:
Determine External (macro) direction.
Look for BOS and OB in the same direction on Internal.
Wait for mitigation (touch) inside the OB; the 50% line can be used for conservative entries.
Good confluences: sessions (killzones), volume spikes, extreme RSI, MAs (add as separate indicators if needed).
Visual Conventions
Demand: green; Supply: red.
Mitigated: faded yellow (or hidden if chosen).
Invalidated: gray (or removed).
50% line: gray.
Notes & Limits
Pine v6. Object caps follow TradingView limits (max_* = 500). On long histories, increase “Max zones stored” carefully.
BOS is computed when price crosses the last confirmed swing; some traders prefer “close-only” confirmation (can be customized if desired).
This tool does not auto-generate BUY/SELL signals; it’s a context & zones assistant.
Risk disclaimer: Trading involves risk. This tool is for educational analysis and does not guarantee profit. Use strict risk management (fixed SL, R:R ≥ 1:2, risk < 1% per trade).
Sürüm Notları
GOLD – OB Clean + Internal/External Market Structure + FIB on EX-CHoCHA precision tool for XAUUSD that blends clean Order Block mapping with Internal/External Market Structure and an auto-Fibonacci module that appears only on external CHoCH (true structure shifts). It’s designed to keep the chart readable, highlight the right zones, and give you a repeatable playbook for entries, targets, and invalidation.
What it does
Finds swing structure using configurable pivots, tracks the most recent external and internal highs/lows, and marks BoS or CHoCH events.
Builds clean OB zones from the last opposite candle in the impulse that broke structure (body or wick logic), auto-extends them, and manages mitigation/invalidation visually.
Drops a FIB stack only on external CHoCH, anchored to the broken swing and its leg extreme—so you get retracement levels where they matter, not on every wiggle.
Why it’s useful
Cuts noise by separating internal vs external structure.
OBs are created only after actual breaks, not just whenever you see a big candle.
FIB appears only on regime change (CHoCH external), giving you ready-made pullback zones (e.g., 0.618/0.707/0.79/0.85) for limit entries or risk-defined continuation.
Core logic (under the hood)
Swings: ta.pivothigh/low with your pivotLen. External and internal swings use different lookback lengths.
Break detection: Robust crossover guards avoid NA issues; BoS/CHoCH labels and lines are drawn with explicit bar-time anchors.
Order Blocks: On BoS/CHoCH, the script searches back lookbackOB bars for the last opposite candle and boxes its body (or wick range, if enabled).
Mitigated: first touch can fade or hide the zone.
Invalidated: close beyond the far edge can gray out or remove the zone (optional).
50% midline and max zone count keep visuals clean and fast.
FIB on EX-CHoCH only:
Bullish CHoCH: 0 at the broken high, 1 at the leg low.
Bearish CHoCH: 0 at the broken low, 1 at the leg high.
Levels, labels, and price readouts are configurable; lines can auto-extend right.
Inputs at a glance
Structure/OB: pivotLen, lookbackOB, useWicks.
Zone management: extendRight, hideMitigated, fadeMitigated, removeInvalid, showMidLine, maxZones.
FIB: toggle on/off, custom CSV levels (0,0.618,0.707,0.79,0.85,1 by default), show labels/prices, extend right, bull/bear colors.
Market Structure: internal/external lengths, choose to show Both / Internal / External.
Gold filter: optional strict filter to run only on XAU/GOLD tickers.
How to trade it (suggested playbook)
Define regime: Use External MS. A fresh CHoCH external flips bias; FIB prints automatically.
Mark confluence: Look for unmitigated OB aligning with FIB 0.618–0.85 and the 50% OB midline.
Entry ideas:
Limit at 0.707–0.79 inside the OB, or
Trigger on lower-TF internal MS shift into the OB.
Stop: Just beyond the OB’s far edge (or a tick beyond the wick if useWicks=true).
Targets:
T1: opposite side of the FIB stack or the midline of the next OB.
T2: the external swing (new HH/LL).
Management: If zone gets mitigated without follow-through or becomes invalidated, step aside—your context changed.
Best practices
Timeframes: H1/H4 for external context; M15/M5 for entries.
Add your usual confluence: RSI divergences, ATR over-extension, volume shifts at the OB, session timing.
Keep maxZones sane (e.g., 40–80) for performance and clarity.
Limitations & notes
It’s a price-structure tool—no magic signals. In ranges, expect more internal flips; rely on external bias.
FIB prints only on external CHoCH by design; if you need FIB on BoS as well, ask and we’ll add a toggle.
Broker symbols for gold vary; use the built-in strict GOLD filter only if your ticker contains XAU/GOLD.
Risk
Trading involves risk. Use proper position sizing, place stops, and don’t treat any OB/FIB level as guaranteed support/resistance. This tool highlights where probability can tilt—you decide if it’s worth the risk.
Want me to add a BoS-only FIB toggle, alerts, or a compact heads-up panel with current bias + nearest OB & FIB cluster?
Sürüm Notları
GOLD — OB Clean + Market Structure + FVG + FIB (EX-CHoCH)A surgical, XAUUSD-first toolkit that fuses Clean Order Blocks, Internal/External Market Structure, Fair Value Gaps, and an auto-FIB engine that triggers only on external CHoCH. Built to remove noise, spotlight asymmetric spots, and give you a repeatable, risk-defined playbook.
What it gives you
True structure map: Separate External trend (regime) from Internal rotation; auto-mark BoS vs CHoCH with time-anchored lines.
Institutional zones, cleaned: OBs from the last opposite candle that powered the break (body/wick mode), with 50% midline, mitigation fade/hide, and invalidation logic.
FVGs that matter: Three-bar gaps (body or wick) with right-extension, midline, mitigation and full-fill invalidation.
FIB on regime change only: Prints on EX-CHoCH (not every wiggle). Bull: 0 at broken high, 1 at leg low. Bear: 0 at broken low, 1 at leg high. Levels are CSV-configurable (e.g., 0/0.618/0.707/0.79/0.85/1), with optional labels and prices.
In-zone context labels: Lightweight center text inside OB/FVG (D/S, B/S), auto-repositioned as zones extend.
How it works (under the hood)
Swings: Parametric pivots define internal vs external highs/lows.
Break logic: Robust crossover guards prevent NA and repaint pitfalls; CHoCH/BoS drawn with bar-time anchors.
OB engine: On a break, search back N bars for the last opposite candle; box its body (or entire wick span). First touch → mitigated (fade/hide). Close through far edge → invalidated (gray/remove).
FVG engine: Detects classical 3-candle imbalance; extends, tracks mitigation, and removes on full fill.
FIB engine: Clears old stack and prints a fresh ladder only when external direction flips (CHoCH), aligning retracement entries with the new regime.
Trade playbook (suggested)
Bias: Use External MS. A fresh CHoCH external flips regime and prints the FIB.
Confluence: Hunt unmitigated OB + FVG overlap inside 0.618–0.85 FIB with the OB 50% nearby.
Entry:
Limit at 0.707–0.79 inside zone, or
Trigger on Internal MS shift on lower TF into that zone.
Invalidation: Stop just beyond OB far edge (or wick in wick-mode).
Targets: T1 = other side of FIB/zone; T2 = opposing external swing; trail after mitigation failure.
Controls you’ll actually use
Structure: pivotLen, internal/external lengths, show Internal/External/Both.
OB: lookbackOB, body/wick, extend right, fade/hide on mitigation, remove on invalidation, 50% midline, max zone count.
FVG: body/wick, extend, midline, mitigation handling, auto-remove on fill, max keep.
FIB: on/off, extend right, labels/prices, custom CSV levels, bull/bear colors.
Gold filter: optional strict XAU/GOLD symbol check.
Why it’s different
Prints FIB only on regime flips (EX-CHoCH) → fewer, higher-signal pullback zones.
Cleans the chart (internal vs external separation, capped objects, lightweight labels).
Encodes mitigation/invalidation so zones don’t linger past their usefulness.
Notes & risk
Designed for XAUUSD; works elsewhere if Gold-filter is off.
Best used H1/H4 for bias; M15/M5 for entries.
No tool removes risk. Size positions, use hard stops, and avoid forcing trades in chop.
Want extras like alerts, bias panel (current external, nearest OB/FVG, active FIB levels), or FIB on BoS toggle? I can add them.
Sürüm Notları
GOLD – OB Clean + MS (Internal/External) + FIB on EX-CHoCH + FVG + Liquidity Pools + In-Zone Text [Dragos]A precision toolkit for smart-money style trading. It auto-maps clean Order Blocks, Internal/External Market Structure (CHoCH/BOS), FVGs, Fibonacci grids on external CHoCH legs, and Liquidity Pools (equal highs/lows → BSL/SSL). Labels and midlines are drawn inside the zones so you see context at a glance, not clutter.
What it does
Order Blocks (OB): Detects after BOS; demand/supply boxes with optional 50% line, mitigation/fade/invalid states, and in-zone D/S labels.
Market Structure: Internal & External swings with CHoCH/BOS tags; external CHoCH auto-deploys a customizable FIB retracement grid.
FVG (Fair Value Gaps): Bull/Bear gaps from wicks or bodies, with 50% line, mitigation/invalid management, and in-gap labels.
Liquidity Pools: Finds Equal Highs/Lows (BSL/SSL). Tolerance can be fixed (USD) or adaptive (%ATR), to fit any symbol/timeframe.
Gold-only Filter: Optional limiter so the script runs only on XAU/GOLD symbols.
Why traders like it
Clean visuals (boxes, dashed levels, tiny labels) optimized for lower TFs (M1–M15) without drowning your chart.
State logic (mitigated/invalid) to keep only the actionable zones.
Adaptive Liquidity via ATR tolerance—works on indices, FX, crypto, metals.
Key Inputs
OB: pivot length, opposite-candle lookback, wicks vs body, extend/fade/hide/invalid options.
Structure: internal/external lengths; color controls.
FIB: levels via CSV, auto-extend, label prices.
FVG: bodies vs wicks, 50% line, mitigation/cleanup.
Liquidity: pivotLen, lookback, tolerance type (USD or %ATR), extend/fade/hide, max kept zones.
General: strictGold on/off.
Tips
For BTC/volatile pairs, set Liquidity Tolerance = %ATR and try 0.20–0.35.
On very busy charts, reduce Liquidity max kept to keep OB/FVG front-and-center.
Disclaimer
This is a technical tool, not financial advice. No indicator guarantees profit—always use risk management.
GOLD – OB Clean + MS (Internal/External) + FIB pe CHoCH Extern + FVG + Liquidity Pools + Text în Zonă [Dragos]
Set complet pentru stilul smart-money. Marchează automat Order Blocks curate, Structura Pieței Internă/Externă (CHoCH/BOS), FVG-uri, Fibonacci pe legul CHoCH extern, și Zone de Lichiditate (equal highs/lows → BSL/SSL). Etichetele și liniile de 50% sunt în interiorul zonelor pentru context clar, fără aglomerație.
Ce face
Order Blocks (OB): după BOS; casete demand/supply cu linie 50%, stări de mitigare/invalidare și etichete D/S în zonă.
Structură de piață: swings interne/externe cu CHoCH/BOS; la CHoCH extern desenează automat FIB personalizabil.
FVG: gap-uri bull/bear din wicks sau corp, cu 50%, mitigare/invalidare și etichete în gap.
Lichiditate: detectează Equal Highs/Lows (BSL/SSL). Toleranță fixă (USD) sau adaptivă (%ATR) pentru orice simbol/timeframe.
Filtru Gold: opțional, rulează doar pe XAU/GOLD.
De ce e util
Vizual curat (boxuri, nivele punctate, etichete mici) optim pentru TF mici (M1–M15).
Logică de stare (mitigat/invalid) → rămân doar zonele cu acțiune.
Lichiditate adaptivă prin ATR—merge excelent pe indici, FX, cripto, metale.
Setări cheie
OB: pivot len, lookback lumânare opusă, wicks vs corp, extindere/estompare/ascundere/invalidare.
Structură: lungimi intern/extern; culori.
FIB: niveluri via CSV, extindere, etichete cu preț.
FVG: corp vs wicks, linie 50%, mitigare/curățare.
Lichiditate: pivotLen, lookback, tip toleranță (USD sau %ATR), extindere/estompare/ascundere, număr max zone.
General: strictGold on/off.
Tips
Pentru BTC/perechi volatile: Toleranță = %ATR și 0.20–0.35.
Dacă e prea încărcat, micșorează max zone Lichiditate ca OB/FVG să rămână în prim-plan.
Avertisment
Instrument tehnic, nu sfat financiar. Niciun indicator nu garantează profit; folosește mereu managementul riscului.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.