OPEN-SOURCE SCRIPT
Diupdate

Unicorn Model (M1D)

632
M1D-

ICT Unicorn Model finds the ICT Unicorn and frames its context.

A Unicorn forms where a displacement leaves a Breaker Block and the Fair Value Gap that displacement traded through inverts onto it — the same-direction Inversion FVG (IFVG) overlapping the Breaker is what confirms the Unicorn: two arrays reinforcing each other at one price, which ICT teaches as a tight, high-probability zone. This tool detects it, marks the Breaker that qualifies, always shows the inversion FVG that makes it one, tracks the liquidity that engineered it, and keeps your HTF bias and the draw on a clean dashboard. It maps structure — it does not fire trades.

The idea (ICT concepts)
The Unicorn is a confluence, not a standalone trigger. The sequence it looks for (bullish; bearish mirrors):

Liquidity is taken — price sweeps a sellside low, engineering the reversal.
A swing is broken — displacement closes through the last swing high (a market-structure shift); the run of candles immediately before that leg is left behind as an Order Block. It becomes a Breaker only once price later closes through it — the OB failing and flipping, exactly as an FVG inverts into an IFVG — its box spanning exactly those candles' high to low.

The FVG inverts onto the Breaker — a candle body closes through the gap, so it fails and flips into an Inversion FVG (IFVG) of the opposite polarity. A Breaker a same-direction IFVG overlaps is the Unicorn; with no overlapping IFVG it stays a plain Breaker.
Bias frames it — the model needs a clear HTF read, so a bullish Unicorn is shown in a bullish / discount context and a bearish one in premium.

The draw — engineered liquidity in the direction of bias is the target the setup delivers toward.
Because the Unicorn is only as good as its narrative, bias is first-class here: qualification is gated to your HTF read by default, and the dashboard keeps the read, the raid and the draw in front of you.

These are established Inner Circle Trader (ICT) concepts — FVG / BISI–SIBI, the Breaker Block, MSS, liquidity, the Midnight Open and premium/discount. This script is an original implementation that detects them and, distinctively, resolves the Breaker + the Inversion FVG that confirms it into a single premium zone rather than plotting each array in isolation.

What it draws
Unicorn — when a live same-direction IFVG overlaps a Breaker, that Breaker box is relabelled Unicorn + (bullish) / Unicorn - (bearish), drawn in the brand purple / magenta and given a distinct dashed border, so the setup reads at a glance and stands apart from the solid-bordered arrays. It is confirmed once and holds — it does not flicker bar to bar — and the confirming IFVG is kept alive with it: the two live and die together, so a Unicorn always shows the inversion that makes it one. It stays on the chart until it is invalidated (below).
Breaker & FVG ingredients — drawn faintly beneath: FVGs in blue (bullish) / red (bearish) and Breakers in a neutral black (a Breaker only takes a directional colour once it becomes a Unicorn), each tagged with the chart timeframe (e.g. Breaker M5, BISI + M5). A BISI / SIBI that sits inside the Unicorn or its inversion hides its own box, so the premium zone is never buried under the ingredient it is built from. Everything invalidates by the candle body only — a wick through a zone never counts. A plain FVG inverts the moment one body closes through it (becoming the IFVG); the Breaker and the inversion take a configurable number of body closes (default two) to retire — or a zone clears once price trends a full range off-screen, keeping only the structure still near price.
IFVG (inversion) — when a candle body closes through an FVG it does not simply vanish; it inverts, flipping polarity to deliver from the other side (the ICT Inversion FVG). The same-direction inversion overlapping a Breaker is what confirms the Unicorn — it is shaded orange (no label — orange reads as IFVG), rendered behind the Unicorn so the premium zone stays in front, and held for as long as the Unicorn is live.
Liquidity — swing highs are buyside, swing lows are sellside, plus prior-day and prior-week levels (PDH / PDL / PWH / PWL) as external-range reference liquidity, each anchored to the candle that formed it. The outermost live swing each side is tagged Buyside Liquidity / Sellside Liquidity (external-range liquidity), inner swings carry Minor Buyside / Minor Sellside, and prior-period levels keep a dated tag. A level that is also the high or low of an Asia / London / New York session window carries that tag too (e.g. NY High, London Low). Every level is removed the instant it is taken — no dotted stub, no lingering line — and any un-taken level that price trends a full range past without returning also clears, so nothing hangs far off the price action. Buyside tags trail the right edge on the line; sellside tags sit back at their origin (left) and just below the line, so the live right edge stays uncluttered and the text clears the price action. Any tags that share a price (e.g. a swing high sitting on the prior-day high) merge into a single combined tag rather than stacking.

Midnight Open (00:00 NY) — a core ICT daily reference and a bias input; below it leans bullish, above it leans bearish.
Draw — the nearest live opposing liquidity in the direction of bias, tagged ← Draw on that level — the target the Unicorn delivers toward. When the draw or the Midnight Open share a level's price they are appended to that one tag rather than stacked as a second label.
Dashboard (M1D™)
HTF Bias — BULLISH / BEARISH / MIXED, auto or manual (auto stacks dealing-range position with the Midnight Open).
Unicorn — whether a bullish, bearish or both-side Unicorn is live in recent context; when none is live it falls back to the last one's direction (bullish (last) / bearish (last)) rather than a bare dash.
Raided — which side of liquidity was most recently taken (the raid that sets up the reversal).
Draw — the current target: nearest live BSL / SSL in the bias direction, with its price.
PDH / PDL — prior-day high and low prices (tracked even when the lines are hidden).
Midnight Open — price above / below the 00:00 NY open.
Dealing range — discount (bullish) / premium (bearish) relative to the swing-range equilibrium.

Settings

General — session timezone, right-side offset (keeps labels in clear space), line- and zone-label sizes.
HTF Bias — Auto / Bullish / Bearish; gate Unicorns to bias on/off; Midnight Open toggle and colour.
Swing Structure — pivot left / right strength.

Liquidity — show liquidity, line colour / width, external + Minor labelling, max live swing levels per side, prior day / week levels (PDH·PDL·PWH·PWL) with days- and weeks-back, and the raid-relevance window.

Sessions — tag session highs / lows on / off, and the Asia / London / New York window times (in the session timezone).

Breaker & FVG — show ingredients, bull / bear colours, FVG minimum height (× ATR), displacement body size (× ATR), biggest-array-wins declutter, the cap on how many
FVGs show at once (so gaps never stack up), show the framing IFVG and its colour, max live zones, the number of body closes that invalidate a zone (default two), and the off-screen retire controls (bars-away, and distance in multiples of the recent price range).

Unicorn — flag Unicorns on / off, bull / bear colours.
Dashboard — show / hide, position (including Middle Right), text size.
Reading it in practice
Trade with the dashboard bias. A Unicorn + / Unicorn - marks the Breaker whose overlapping inversion FVG makes it a Unicorn; the orange IFVG shows the imbalance it sits within. ICT guidance waits for price to tap the FVG side, places the stop beyond the combined Breaker + FVG extreme (whichever is furthest), and targets the engineered liquidity marked by the ← Draw tag. A gap left open below a bullish Unicorn range is intended — it shows bullish intent and speed, and is not meant to be filled.

Repainting
All detection evaluates on closed bars — swings, the MSS / Breaker flip, FVGs, the inversion and the Unicorn overlap are confirmed on candle close, never intrabar. Once a Unicorn is confirmed it is locked — it does not re-evaluate or flip state bar to bar — and invalidation is counted only from confirmed body closes, so an in-progress candle (including a wick through a zone) does not remove it. The Midnight Open fixes on its forming bar and levels anchor to the candle that formed them. Live zones and levels extend to the right edge for readability; that right-side projection is cosmetic and does not change any confirmed level, tap or raid.

Analytics only
This is a decision-support tool for discretionary ICT study — it maps zones, structure and context. It contains no alerts, no arrows, and no buy / sell signals, and it does not tell you when to enter or exit.

Built by M1D. For education and study of price delivery — not financial advice.
Catatan Rilis
What's new

Cleaner labels — Sellside liquidity labels now sit just beneath their level to stay clear of the price action, and liquidity reads as external (Buyside / Sellside Liquidity) vs internal (Minor Buyside / Minor Sellside) at a glance.

Session highs & lows — a level that's the high or low of the Asia, London or New York session is now tagged as such (e.g. NY High, London Low).

Breaker logic — a Breaker now forms only once price closes through the order block, so order blocks are no longer flagged as Breakers prematurely.

Unicorn refinements — confirmed by the inversion FVG it sits inside, one setup per swing (no more stacking), and zones retire once their target is reached so the chart stays clean and near price.

Dashboard accuracy — prior-day / prior-week rows now read the live levels straight from the chart, so the table always matches what's drawn.

Session timezone — updated to reflect the correct time.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.