INVITE-ONLY SCRIPT
Güncellendi

ICT Unicorn SMC Malibu

2 207
This invite-only, closed-source overlay is a structural market visualization tool built around widely known ICT/SMC concepts and independently implemented in Pine Script. Its purpose is to map market structure and liquidity-related zones on the chart, then keep those zones updated as price evolves.

The script does not generate buy or sell signals, does not provide execution instructions, and does not include built-in alerts, automation, or trade management. Its role is to help the user read structure, monitor key zones, and follow how those zones develop, react, or become invalid over time.

The overlay combines several well-known ICT/SMC components into one structured workflow, including swing structure, Buy-Side and Sell-Side Liquidity levels, BOS and ChoCH shifts, Order Blocks, Breaker Blocks, Fair Value Gaps, Inverse Fair Value Gaps, and the Unicorn concept.

The workflow begins with pivot-based swing detection. Confirmed swing highs and lows are used to define structure and project liquidity levels. The script then monitors whether price interacts with or sweeps those areas. After liquidity is taken, the overlay evaluates close-based structure breaks and classifies them as BOS or ChoCH. These structural events are not treated as isolated labels, but as part of the broader logic that governs downstream zone creation and chart organization.

Order Blocks are not created from candle appearance alone. They require a structural sequence in which liquidity is first taken and a later confirmed structure break validates the move. Breaker Blocks are handled separately through failed continuation logic. Fair Value Gaps are detected through the standard three-bar imbalance relationship, and invalidated gaps can continue to be tracked as Inverse Fair Value Gaps rather than remaining as static historical markings.

A key part of the overlay is the Unicorn concept. When an active Breaker Block and an active Fair Value Gap overlap in price, the script identifies that shared region as a dedicated Unicorn zone. This is not treated as a separate signal engine, but as a structural overlap area derived from two existing zone types. In practice, this allows the chart to highlight meaningful BB/FVG intersections without leaving multiple partially redundant zones competing in the same location.

The script also manages zone lifecycle after creation. Active zones are extended while they remain valid, then faded or removed once they are mitigated or invalidated by later price action. Duplicate or near-overlapping zones are suppressed to improve chart readability during repeated structural events. The goal is not to preserve every historical zone indefinitely, but to keep attention focused on structure that is still relevant.

Depending on the layers enabled by the user, the overlay can display Order Blocks, Breaker Blocks, Fair Value Gaps, Inverse Fair Value Gaps, Unicorn zones, BOS and ChoCH lines, liquidity levels, and optional session context through Kill Zones. These visual elements are intended to serve as structural references for the user’s own discretionary analysis.

How to use it: this script is best used as a market structure and zone-mapping tool. A practical workflow is to monitor liquidity levels and structure shifts first, then observe how price interacts with active OB, BB, FVG, IFVG, and Unicorn areas. BOS and ChoCH can be used to read structural continuation or character change, while mitigated or invalidated zones can be treated as no longer active within the script’s framework.

Potential reversal areas should be treated as reaction zones rather than automatic trade signals. Once price reaches an active zone, the user can monitor whether that area begins to act as support or resistance, whether price is rejected, accepted, or consolidated around it, and whether the surrounding structure remains valid. In practice, these zones are intended to help frame possible turning points, continuation reactions, or invalidation areas within the broader market structure.



Important notes and limitations:

BOS, ChoCH, and liquidity levels are derived from confirmed pivot structure, so they appear only after the required swing lookback has been satisfied. This script is a structural reference tool and does not produce buy or sell signals, execution instructions, or trade alerts. It does not include built-in stop-loss, take-profit, or risk/reward modules. Active zones can become mitigated or invalidated through later price action and may be faded or removed depending on settings. Fair Value Gap detection can show minor live-bar instability while the current bar is still forming. The script operates on the chart’s native timeframe only and does not use multi-timeframe security calls.

The concepts used here are widely known in ICT/SMC analysis. What this overlay adds is a structured lifecycle for those concepts on chart: structure detection, liquidity tracking, zone creation, Unicorn overlap recognition, mitigation handling, and clutter reduction inside a single visual workflow.




The main convenience this provides to the user is that it removes the need to manually sort through every structure that appears on the chart. The script filters out weaker setups that form without a liquidity sweep, creates Order Blocks only after structural confirmation, filters Fair Value Gaps through ATR-based thresholds, and can place those structures within higher-significance session context through the optional Kill Zone time filter. In addition, it hides duplicate, heavily overlapping, or no longer valid areas, helping the user focus on zones that are cleaner, more meaningful, and still worth monitoring. This makes the chart easier to read, the structure easier to follow, and the overall workflow more efficient.
Sürüm Notları

ICT Unicorn SMC Malibu

DESCRIPTION
ICT Unicorn SMC Malibu is a closed-source, invite-only ICT/SMC workflow indicator built to organize liquidity interaction, structure confirmation, imbalance state changes, and Unicorn-style overlap logic inside one chart framework.

This script is not intended to be a loose collection of common ICT/SMC labels. The protected value is not the use of isolated public concepts by themselves, but the way they are combined, filtered, timed, and managed together as one workflow. Its value comes from the interaction between pivot-confirmed swing structure, liquidity sweeps, close-confirmed BOS / ChoCH logic, Order Block and Breaker validation, FVG / IFVG state transitions, zone lifecycle control, configurable visual persistence, and Unicorn formation only when structure and imbalance conditions align. That combined workflow is why this script is published as closed-source and invite-only.

The script tracks:
• pivot-confirmed swing structure
• buy-side and sell-side liquidity interaction
• BOS / ChoCH structure events
• Order Blocks
• Bullish and Bearish Breaker Blocks
• Fair Value Gaps (FVG)
• Inverse Fair Value Gaps (IFVG)
• Unicorn overlap conditions
• optional Kill Zone visualization for Asia, London, New York AM, and New York PM
• optional New York 10:00–11:00 Unicorn filtering

What makes it different

Order Blocks, Breakers, FVGs, IFVGs, and Unicorns are not treated as unrelated labels. They are handled as one confirmation-based workflow.

Order Blocks are used as reaction areas after liquidity and structure context align, rather than simply marking broad historical candles.

Breaker Blocks are intended to be more selective than loose visual breaker labeling, so breaker context depends on stronger structure alignment.

FVG and IFVG are handled as different imbalance states, allowing the script to distinguish continuation imbalance from failed or flipped imbalance instead of treating both as the same zone type.

Unicorn zones are created only when valid breaker context and valid imbalance context overlap under the script’s rules. In this workflow, Unicorn is not just any visual overlap between two areas; it is a filtered overlap condition. This version also includes an optional New York-only Unicorn timing filter for traders who want a more selective New York session workflow.

What changed in this update

This update makes the workflow more selective, more state-aware, more configurable, and more explicit in how active zones behave over time.

• Order Block handling was refined so reaction areas fit the confirmed liquidity-to-structure sequence more cleanly.
• Breaker logic was tightened so stronger structure alignment is required before a breaker is accepted.
• FVG and IFVG handling was separated more clearly so continuation imbalance and invalidated imbalance are treated as different states.
• Unicorn formation was made more context-dependent, and an optional New York 10:00–11:00 Unicorn filter was added for a more selective New York-only workflow.
• Zone lifecycle management was expanded so active areas can be managed through mitigation behavior, persistence rules, interaction count, repeated inside-close behavior, and age limits.
• New visual-control features were added, including Mitigated Zones, Faded Opacity, Max Zones, Max Bullish FVG, Max Bearish FVG, Max Bullish IFVG, Max Bearish IFVG, Max Touches, Max Zone Age, Keep mitigated FVGs, and Show Swing Confirmation Marks.
• A Publication Safety section was added with Strict Confirmed Mode, Close-Confirmed Liquidity Sweeps, and Keep Pivot Price Anchored To Pivot Bar.

Why these changes were made

The goal of this update was not to add more labels, but to improve selectivity, separate market states more clearly, reduce stale zones, make chart behavior easier to manage, and create a cleaner confirmation-first workflow.

How it works

The script first builds swing structure from confirmed pivots, then monitors liquidity interaction around those levels. When liquidity and structure confirmation align, it can form context-aware Order Block, Breaker Block, FVG, IFVG, and Unicorn zones depending on the sequence of events.

Instead of treating all zones the same way, the workflow separates structure-based zones from imbalance-state transitions and manages them through lifecycle rules. This is intended to keep the chart more informative over time and reduce stale areas that no longer reflect meaningful context.

Confirmation behavior

Swing points are pivot-confirmed, so some structural elements appear only after confirmation. Core structure events are confirmation-based, and some drawings may remain anchored to the original pivot area after later confirmation for readability. This script is designed around confirmed context rather than early anticipation.

How to use it

This is an indicator, not a strategy. It is intended to help traders read structure, liquidity, imbalance, and reaction zones through a more organized confirmation-based workflow. It should be used with the user’s own execution model, filtering process, and risk management.

A practical workflow is:
1. let the script confirm swing structure
2. observe liquidity interaction around prior structural levels
3. wait for BOS / ChoCH context to confirm whether structure has shifted or continued
4. use Order Block, Breaker Block, FVG, IFVG, and Unicorn information to evaluate where reaction or continuation may matter most
5. use the zone and visual-control settings to manage chart clarity according to your workflow
6. if desired, use the optional New York Unicorn filter for more selective New York-only Unicorn conditions

Alerts

The script supports alerts for key structure and zone-creation events. For the most conservative use, alerts are best configured Once Per Bar Close.

AUTHOR’S INSTRUCTIONS
To request access, please send me a private TradingView message including your TradingView username.

Please do not use the comments section for access requests.

Access is managed manually.
Sürüm Notları
This update is a major revision of the script’s internal structure, setup qualification logic, and chart workflow. The interface was reorganized so related controls are grouped more clearly, Fair Value Gap settings are separated into a dedicated section, BOS and ChoCH controls are handled from the display layer, and each Kill Zone can now be managed independently with editable session colors.

Several low-level technical controls were removed from the public input layer and converted into fixed internal constants. Swing length was also locked to a fixed internal value. The goal of these changes is to keep the script more consistent from one chart setup to another and reduce unnecessary parameter noise in the user workflow.

Liquidity handling was revised as well. Liquidity levels are now enabled by default, the tracked line capacity was expanded, and swept liquidity is no longer left behind as stale chart context. Once taken, the corresponding liquidity line is fully deleted and removed from its tracking array so the active map remains focused on levels that are still structurally relevant.

The Fair Value Gap workflow was refined to keep the chart cleaner and the logic more context-aware. Mitigated FVGs are no longer shown by default, invalidation timing now scales with timeframe, and zone invalidation now relies on candle body confirmation rather than wick-only penetration. This makes zone status depend more on accepted price movement and less on isolated wick activity.

A broader timeframe-scaling layer was also added. Multiple internal thresholds now adapt automatically to the active chart resolution instead of relying on one static set of values. This affects scan windows, lifespan rules, and setup qualification timing so the script remains more proportionate across different timeframes.

The Unicorn module received the largest upgrade. Each setup now receives a 0-100 DNA score, and the script no longer treats every valid overlap as equal. The scoring model evaluates overlap quality, displacement context, recent structural events, FVG timing, and the internal relationship between the Fair Value Gap and the surrounding Breaker Block.

A topology layer was added to classify where the FVG sits inside the Breaker Block, and a dynamic overlap model was introduced so the required overlap is adjusted to current volatility conditions. When multiple candidates exist, the script now compares them and selects the highest-scoring valid Unicorn instead of simply accepting the first match found.

The visual layer was updated to reflect that ranking process. Unicorn box color now varies by score intensity, labels can display both the score and a compact quality marker, and voided setups can optionally remain visible with separate styling. BOS and ChoCH timing is also recorded and fed back into the scoring process to give setup qualification more structural context.

Confirmation and stability handling were tightened in the same release. Swing detection now runs on confirmed bar closes only, a separate alert condition was added for voided Unicorn states, and object deletion routines now include safety checks before cleanup. Taken together, this update is a broader revision of how the script forms, ranks, tracks, invalidates, and manages Unicorn structures across changing chart conditions.
Sürüm Notları
This update is a major revision of the script’s internal structure, setup qualification logic, and chart workflow. The interface was reorganized so related controls are grouped more clearly, Fair Value Gap settings are separated into a dedicated section, BOS and ChoCH controls are handled from the display layer, and each Kill Zone can now be managed independently with editable session colors.

Several low-level technical controls were removed from the public input layer and converted into fixed internal constants. Swing length was also locked to a fixed internal value. The goal of these changes is to keep the script more consistent from one chart setup to another and reduce unnecessary parameter noise in the user workflow.

Liquidity handling was revised as well. Liquidity levels are now enabled by default, the tracked line capacity was expanded, and swept liquidity is no longer left behind as stale chart context. Once taken, the corresponding liquidity line is fully deleted and removed from its tracking array so the active map remains focused on levels that are still structurally relevant.

The Fair Value Gap workflow was refined to keep the chart cleaner and the logic more context-aware. Mitigated FVGs are no longer shown by default, invalidation timing now scales with timeframe, and zone invalidation now relies on candle body confirmation rather than wick-only penetration. This makes zone status depend more on accepted price movement and less on isolated wick activity.

A broader timeframe-scaling layer was also added. Multiple internal thresholds now adapt automatically to the active chart resolution instead of relying on one static set of values. This affects scan windows, lifespan rules, and setup qualification timing so the script remains more proportionate across different timeframes.

The Unicorn module received the largest upgrade. Each setup now receives a 0-100 DNA score, and the script no longer treats every valid overlap as equal. The scoring model evaluates overlap quality, displacement context, recent structural events, FVG timing, and the internal relationship between the Fair Value Gap and the surrounding Breaker Block.

A topology layer was added to classify where the FVG sits inside the Breaker Block, and a dynamic overlap model was introduced so the required overlap is adjusted to current volatility conditions. When multiple candidates exist, the script now compares them and selects the highest-scoring valid Unicorn instead of simply accepting the first match found.

The visual layer was updated to reflect that ranking process. Unicorn box color now varies by score intensity, labels can display both the score and a compact quality marker, and voided setups can optionally remain visible with separate styling. BOS and ChoCH timing is also recorded and fed back into the scoring process to give setup qualification more structural context.

Confirmation and stability handling were tightened in the same release. Swing detection now runs on confirmed bar closes only, a separate alert condition was added for voided Unicorn states, and object deletion routines now include safety checks before cleanup. Taken together, this update is a broader revision of how the script forms, ranks, tracks, invalidates, and manages Unicorn structures across changing chart conditions.
Sürüm Notları
**Version 3**

This update revises several core parts of the script’s internal detection and state-handling flow.

Displacement checks now include a volume-based filter using `useVolFilter`, `volMult`, and `volSMA`, adding an extra confirmation layer to the existing displacement conditions. Breaker Block break detection was extended with a broader retrospective scan window, and the bullish and bearish Breaker Block paths were adjusted to behave more symmetrically. The BOS / ChoCH scan scope was also expanded. In addition, minimum floors were added for `dynBBBreakMaxBars` and `dynBBMaxAge` so those dynamic values do not contract below their intended lower limits.

On the Unicorn side, active Unicorn state tracking was added and refined to make setup-state handling more explicit during runtime. `UnicornBuildResult` was expanded, and `updateUnicornState()` was added to support that flow more clearly. TP-based trail alerts were also added as part of the active-state alert sequence.

Internally, the alert boolean structure was simplified, unused feature-flag constants were removed, the overlap-threshold calculation was moved into a cached flow, and zone lifecycle handling was consolidated into a single function. This version also adds `MAX_HISTORY_LOOKBACK = 999`, introduces additional safety guards in historical scan helpers, and adds `findInternalHighData` / `findInternalLowData` helper functions.

State persistence was also tightened in two areas: liquidity sweep state updates are now written back to their array, and Unicorn `isUnicorn` state updates are also written back to their array so those changes persist in the underlying data structures.

As a visible chart-level adjustment, liquidity lines now use a solid style instead of a dashed style.
Sürüm Notları
Update Notes

This update improves the stability, accuracy, and performance of ICT Unicorn SMC Malibu while keeping the core Unicorn logic unchanged.

What changed:

- Improved LTF/HTF behavior
Lookback windows are now more adaptive across different timeframes. This helps reduce overly short logic on lower timeframes and overly loose logic on higher timeframes.

- Improved FVG and IFVG lifecycle
Fair Value Gaps now use their own age limit more correctly, reducing the chance of very old FVG zones being used in new setups.

- Cleaner Unicorn matching
Breaker Block and FVG matching is now more time-consistent, helping avoid forced or outdated Unicorn combinations.

- More accurate scoring
Unicorn score now respects directional structure context more carefully, reducing the chance of bullish setups receiving score from bearish structure context, or vice versa.

- Better chart performance
BOS and ChoCH drawings are now managed with limits, helping reduce line and label buildup on lower timeframes.

- Reduced unnecessary objects
Hidden FVG and Breaker Block zones no longer create unnecessary invisible boxes when visual display is disabled.

- Cleaner labels
Unicorn and void labels were simplified for better readability on the chart.

Expected behavior:

The indicator should feel lighter on lower timeframes and more selective on higher timeframes. Unicorn setups should remain based on the same core logic, but with cleaner matching, better lifecycle handling, and more reliable scoring.
Sürüm Notları
This update focuses on improving the structural quality, consistency, and usability of the Unicorn model in ICT Unicorn SMC Malibu.

The main objective was not to increase signal frequency, but to make Unicorn detection more selective, reduce weak formations, and improve the overall model workflow through stronger validation and cleaner chart behavior.

What changed

The Unicorn detection logic has been reworked. A Breaker Block and FVG overlap alone are no longer enough to qualify as a valid Unicorn. The model now requires stronger alignment between Liquidity Sweep, MSS / ChoCH, Displacement, Breaker Block, and FVG Overlap, which helps filter out weaker or incomplete formations.

The overall Unicorn quality threshold has also been raised. Low-quality zones, shallow overlaps, and structurally weak setups are now filtered more aggressively. The goal is not more signals, but cleaner and more selective model output.

Breaker Block + FVG overlap validation has been strengthened to require more meaningful price interaction. Thin or superficial overlap areas are less likely to qualify.

FVG filtering has also been improved. Small three-candle imbalances are no longer treated equally by default. ATR-based minimum size logic and displacement context now play a larger role in determining whether an FVG is significant enough to contribute to a valid Unicorn.

The displacement requirement has been strengthened through stricter momentum and expansion filtering, helping reduce setups formed by weak price movement.

Liquidity sweep logic has been refined so that simple high/low breaches are less likely to be treated as meaningful sweep events. Bullish and bearish sweep behavior is now handled with clearer structural rules, and the market response after the sweep carries greater importance.

MSS / ChoCH confirmation has also been improved, with stronger close-based validation and better directional bias handling to reduce ambiguity.

Breaker Block validation is now more selective, with improved handling of failed-structure and flip behavior.

Workflow improvements

A major change in this version is the separation between Unicorn Zone and Entry Confirmation.

Zone creation no longer implies direct entry confirmation. Retest and reaction-based behavior now play a larger role, and entry confirmation is only produced after price returns to the zone and interacts with it more meaningfully.

Input and usability improvements

The input panel has been reorganized into a cleaner structure:

Core Model, Market Structure, Liquidity, FVG / IFVG, Breaker Blocks, Unicorn Setup, Entry Confirmation, Filters, Visual Style, and Alerts

The Core Model section now includes three modes:

Conservative — fewer but stricter setups
Balanced — default balanced behavior
Aggressive — more flexible detection

To simplify the experience and improve consistency, Swing Length / Pivot and Lookback Window are no longer exposed as manual inputs. These behaviors now adapt automatically based on timeframe context.

Visual and alert improvements

The visual layer has been cleaned up to reduce unnecessary FVG, OB, BB, and Unicorn clutter. Handling of mitigated and invalidated zones has also been improved so that more relevant active areas remain easier to read.

Alert flow has been separated into clearer stages:

Unicorn Zone Created
Unicorn Retest
Unicorn Entry Confirmed
Unicorn Invalidated
Final note

This release is primarily a structural quality, consistency, and workflow update. The internal codebase has been refactored to reduce repetition, improve lifecycle management, and make the overall model more stable, maintainable, and predictable in practical use.

This update focuses on cleaner structure detection, fewer false positives, more consistent behavior, and a more reliable Unicorn model workflow.
Sürüm Notları
**Update Notes**

This update focuses on improving internal confirmation logic, chart clarity, and consistency of zone management.

The Unicorn detection workflow has been refined to rely on stricter structural context before a zone is formed. Instead of accepting weaker overlaps too easily, the script now applies tighter evaluation around liquidity interaction, market structure progression, displacement quality, and the relationship between Breaker Blocks and Fair Value Gaps. The result is a more selective process intended to reduce low-quality formations and keep only structurally cleaner setups on the chart.

Breaker Block and Order Block handling has also been revised. Zone construction is more controlled, weaker zones can be filtered more effectively, and repeated or aging zones are managed with clearer invalidation behavior. This helps reduce clutter and makes active context easier to read during live chart review.

The Fair Value Gap module was expanded with additional filtering and display controls. Smaller gaps can be handled more selectively, mitigation behavior is cleaner, and the script maintains a tighter link between FVG conditions and the broader setup sequence. This is designed to improve readability without changing the core purpose of the tool.

Another important part of this update is improved bar-close consistency. More parts of the logic now depend on confirmed candles and controlled state handling, which helps reduce unstable intrabar behavior and keeps structure evaluation more consistent from bar to bar.

Zone lifecycle management has been improved across OB, BB, FVG, IFVG, and Unicorn areas. Age, mitigation state, repeated interaction, and invalidation are now handled in a more disciplined way so outdated zones do not remain visible longer than needed.

Alert coverage has also been expanded. In addition to structural and zone-creation events, the script now supports more detailed workflow notifications related to retests, confirmation behavior, invalidation, and follow-through events tied to the active setup logic.

This release also includes visual and control-side improvements. Users now have more flexibility over filtering, overlap quality, displacement requirements, display behavior, and session-based constraints, allowing the script to be configured more precisely while keeping the model itself more selective.

This update is intended to improve clarity, internal consistency, and chart usability. It does not guarantee performance or future results, and the script should be used as a decision-support tool within the user’s own process.
Sürüm Notları
This update introduces significant structural, logical, and visual improvements to the indicator. The core mechanics have been completely rewritten to prevent false signals, enhance calculation accuracy, and provide users with greater control over the criteria used to identify market structures.

Here is a detailed breakdown of what has changed, why it changed, and how it improves your trading analysis:

## 1. Core Logic Enhancements & Repaint Prevention
* **Bar Confirmation Requirement (`barstate.isconfirmed`):**
* **What Changed:** Break of Structure (BOS), Change of Character (ChoCH), and Fair Value Gap (FVG) formations are now strictly evaluated only upon candle closure.
* **Why It Changed:** In the previous version, real-time price fluctuations could cause the indicator to draw and subsequently erase structures before the candle closed (repainting).
* **Benefit:** This guarantees that structural changes and FVG zones are historically permanent and reliable once plotted. As a result, the starting point for FVG boxes has been adjusted to account for the confirmed 3-bar formation.

## 2. Advanced Event Tracking (State Machine)
* **Unique Event IDs:**
* **What Changed:** A sophisticated tracking system has been implemented using `eventCounter`, `eventId`, and `sweepIdx`.
* **Why It Changed:** Previously, the indicator evaluated structures (like Sweeps, OBs, and BOS) somewhat independently.
* **Benefit:** Every liquidity sweep and subsequent structural break is now chained together into a unique "Event". This allows the algorithm to understand the exact chronological sequence of the market, ensuring that related components (e.g., the FVG that caused a specific BOS) are properly linked.

## 3. Stricter Order Block (OB) Validation
* **Displacement Requirement (ATR-Based):**
* **What Changed:** A strict displacement condition has been added. For an OB to be plotted, the move from the OB candle to the BOS close must exhibit significant momentum, calculated dynamically using ATR (e.g., `(close - obBtm) >= atr * 0.25`).
* **Why It Changed:** The old version plotted an OB whenever a sweep and a BOS occurred, which often resulted in weak, low-probability zones being highlighted during low-volume periods.
* **Benefit:** The indicator now filters out sluggish market movements. Only Order Blocks that lead to a meaningful, energetic displacement are displayed, significantly increasing the quality of the zones.

## 4. Breaker Block (BB) Mechanism Overhaul
* **Sequential Logic & Bug Fix:**
* **What Changed:** The Breaker Block detection algorithm has been entirely rebuilt to follow a strict chronological sequence: Liquidity Sweep -> Failed Counter OB -> BOS.
* **Why It Changed:** The previous version suffered from a loop bug that occasionally misidentified or missed BB formations.
* **Benefit:** Breaker Blocks are now identified with absolute mechanical precision, requiring all steps of the formation to occur in the exact correct order.

## 5. Precise Unicorn Model Formation
* **Event ID Matching Requirement:**
* **What Changed:** A Unicorn model is now only formed if the Breaker Block (BB) and the Fair Value Gap (FVG) belong to the *exact same structural event* (`fvg.eventId == bb.eventId`), in addition to overlapping spatially.
* **Why It Changed:** The previous logic only checked if a BB and an FVG overlapped in price, which sometimes linked an old Breaker Block with a completely unrelated, newly formed FVG.
* **Benefit:** This ensures that the Unicorn setup is contextually accurate. The FVG must be the direct result of the displacement that caused the specific Breaker Block, eliminating false structural alignments.

## 6. Code Optimization and Clean Data Structures
* **Independent Inverse FVG (IFVG) Arrays:**
* **What Changed:** Converted IFVGs are now stored in dedicated arrays (`bullIFVGs`, `bearIFVGs`) rather than being mixed back into the standard FVG arrays.
* **Benefit:** This prevents data crossover and makes the internal logic much cleaner and faster.
* **Memory Management (Cleanup Loops):**
* **What Changed:** Added aggressive memory cleanup routines. Once a zone is converted (e.g., into a Unicorn) or mitigated, it is completely removed from the calculation arrays.
* **Benefit:** Prevents the indicator from slowing down over time and reduces visual clutter.
* **Refined Duplication Filters:** The ATR tolerance for preventing duplicate FVG boxes was tightened (from 0.1 to 0.08) for better precision on smaller timeframes.

## 7. New User Settings (Inputs)
To give you more control over the new stricter logic, the following settings have been added:

* **"BB / Unicorn Event" Settings Group:**
* **Max Sweep→BOS Bars:** Defines the maximum number of bars allowed between the initial Liquidity Sweep and the subsequent Break of Structure. (Default: 30).
* **Max Displacement Bars:** Defines the maximum number of bars allowed after a BOS for an FVG to be considered part of that specific displacement move. (Default: 8).
* *Why this matters:* You can now adjust the indicator's sensitivity to time. If a setup takes too long to unfold, you can instruct the indicator to invalidate it.
* **Visual Enhancements:**
* **Show Box Borders:** A new toggle allowing users to turn zone borders on or off for a cleaner chart appearance.
Sürüm Notları
Update Notes / Release Changelog
1. Price Scale & Visual Rendering Fix
What Changed: Replaced location.bottom with location.belowbar inside all plotshape() calls for Kill Zone session labels.
Reason: Using location.bottom in overlay indicators forces the TradingView vertical auto-scaling engine to extend Y-axis boundaries to the bottom of the chart pane, causing severe candlestick compression. Using location.belowbar anchors the labels near price bars, resolving chart scale distortion.
2. Array Traversal & Performance Optimization
What Changed: Standardized reverse array loops (for i = size - 1 to 0) across Liquidity Line updates, IFVG conversions, and zone mitigation loops. Pre-cached array sizes (array.size()) into local variables prior to loop entry.
Reason: Reverse iteration prevents index-out-of-bounds errors when array elements are dynamically removed (array.remove()) during iteration. Pre-caching array lengths eliminates redundant function calls per bar execution, optimizing performance across historical data.
3. Status Line Visual Cleanliness
What Changed: Applied display = display.none across all input() parameter definitions and plotshape() functions.
Reason: Suppresses input values and plot outputs (e.g., 0.0 values) from crowding the indicator title in the chart Status Line and Data Window, while retaining full functionality in the script settings menu.
4. Variable Scope & Memory Cleanup
What Changed: Converted per-bar flags (bslSwept, sslSwept, bosUp, bosDown) from persistent var scope to standard local scope. Removed unused global variables (pendingBullLiq, pendingBearLiq).
Reason: Variables intended to reset on every bar execution should not maintain persistent state across historical bars. Removing unreferenced global variables optimizes memory footprint and improves code structure.
5. Conditional Execution for Session Calculations
What Changed: Enclosed Kill Zone time checking logic (time(...)) inside conditional execution blocks (if showKZ).
Reason: Prevents unnecessary background execution of session time lookups when Kill Zone visual features are disabled by the user.
6. User Settings Interface Simplification
What Changed: Replaced technical input parameters (maxSweepToBosBars set to 30, maxDispBars set to 8) with fixed script-level constants.
Reason: Streamlines the user inputs interface by removing redundant technical options while keeping the underlying structural logic completely unchanged.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.