Advanced Fibonacci Golden Zone [HexaTrades]Advanced Fibonacci Golden Zone automatically finds the market's significant swing legs and projects the Fibonacci Golden Zone, the 0.5 – 0.618 retracement pocket of the latest leg. That band is where trend-continuation entries are classically hunted. No manual fib drawing: the script detects the swing, anchors the retracement correctly for both directions, draws the zone the moment the swing confirms, manages the setup's whole lifecycle, and drives a duplicate-free alert stream.
⭐️How it works
True late-zone detection:
When a swing confirms, the script scans every bar from the actual pivot through the confirmation bar (wicks or closes, per Zone Touch Source). If the price has already reached the zone's near edge anywhere in that window, the zone is late and is skipped; no zone is ever painted behind a reaction that already happened. Strict rule: exactly touching the edge counts as late.
Superseded setups :
A skipped candidate retires the previously active setup immediately: status “Superseded”, zone frozen/faded, and total silence no false “Invalidated” alert (that one is reserved for setups price actually broke).
Invalidation frozen ATR buffer:
A setup dies when a bar closes beyond the protective swing by more than the Invalidation Buffer (× ATR). The buffer is measured once, at setup creation, and the invalidation price stays fixed for the setup's lifetime; later ATR changes can't move it. Dead zones gray out instantly and can never alert again; a broken leg is “poisoned” so its later extensions can't spawn a fresh setup.
Zone anchoring retracements vs projections
Bullish (up-leg): Retracement anchored at 0.0 at the high, 1.0 at the low → the 0.5–0.618 band sits below price as potential support.
Bearish (down-leg) : Mirror-anchored → the 0.5–0.618 band sits above the price as potential resistance.
Retracements (0–1.0) and continuation projections (1.272× / 1.618× of the impulse, beyond the extreme) are computed by separate functions and labelled separately projections are targets, not retracement ratios.
True late-zone detection :
When a swing confirms, the script scans every bar from the actual pivot through the confirmation bar (wicks or closes, per Zone Touch Source). If the price has already reached the zone's near edge anywhere in that window, the zone is late and is skipped; no zone is ever painted behind a reaction that already happened. Strict rule: exactly touching the edge counts as late.
Superseded setups:
A skipped candidate retires the previously active setup immediately: status “Superseded”, zone frozen/faded, and total silence no false “Invalidated” alert (that one is reserved for setups price actually broke).
Invalidation frozen ATR buffer:
A setup dies when a bar closes beyond the protective swing by more than the Invalidation Buffer (× ATR). The buffer is measured once, at setup creation, and the invalidation price stays fixed for the setup's lifetime; later ATR changes can't move it. Dead zones gray out instantly and can never alert again; a broken leg is “poisoned” so its later extensions can't spawn a fresh setup.
⭐️ Features
- Automatic Golden Zone (default 0.5 – 0.618, both ratios configurable)
- Optional fib levels: retracements 0 · 0.236 · 0.382 · 0.5 · 0.618 · 0.786 · 1.0 + separately labelled 1.272× / 1.618× projections
- ZigZag + HH / HL / LH / LL structure labels with live structure bias
- Historical zones stay frozen & softened; optional “One zone per leg” replaces same-leg drafts in place (off by default)
- Zone lifecycle: Waiting → Inside Zone → Rejected / Broke Out → Invalidated / Superseded dead zones gray out and go permanently silent
⭐️How to use it
- Wait for a fresh zone in the direction of the structure (HH+HL → longs, LH+LL → shorts).
- Let price come into the zone covered by the “Price Enters Golden Zone” .
- Look for the rejection: a candle that gets into the zone and closes back out in the trend direction.
- Targets & invalidation: Target 1 = the 0.0 level (the impulse extreme), Target 2 = the 1.272× projection, Target 3 = the 1.618× projection; status “Invalidated” (close beyond the protective swing + buffer) is the classical exit.
⭐️Alert
1 · Golden Zone Invalidated: close beyond the protective swing + frozen ATR buffer — kills the setup
2 · 1.618× Projection Reached: continuation target hit (also completes 1.272× if reached directly)
3 · 1.272× Projection Reached: continuation target hit
4 · Bullish / Bearish Rejection: candle gets into the zone, closes back out in trend direction (completes the entry latch too)
5 · Zone Breakout: price closes straight through the zone
6 · Price Enters Golden Zone: first touch of the zone
No zone-interaction alert can fire on the candle that creates a setup; signals are eligible from the following confirmed candle.
Bar-close confirmation is enforced in code (barstate.isconfirmed is part of every alert condition); alerts cannot trigger intrabar regardless of the frequency you pick. Still select “Once Per Bar Close”.
Advanced Fibonacci Golden Zone combines confirmed market structure, automatic Fibonacci mapping and complete setup management in one tool. It helps traders identify fresh retracement opportunities without manually drawing Fibonacci levels while keeping invalidation, projections and alerts consistent. Use it alongside trend context, price action and proper risk management—not as a standalone entry signal.
We would love to hear your suggestions. If you have ideas for new features, indicators, analytics, or improvements, please share your feedback. Your input helps guide future updates and improve the indicator for all traders.
Wedge pattern detector indicator is for educational and analytical purposes only. It is not financial advice. Trading involves risk. Always use proper risk management and combine this indicator with your own analysis before taking any trade.
Chỉ báo






















