ICT Unicorn Model [Kodexius]ICT Unicorn Model is a market structure and imbalance confluence tool that automatically detects high probability “Unicorn” setups by combining three key elements into a single, clean script:
-A first, clean break of that swing level (displacement style break)
-A Fair Value Gap that overlaps a breaker candle body range
Instead of plotting every pivot or every imbalance independently, the script waits for a specific sequence: price establishes a valid swing, breaks that swing for the first time, and prints a setup only when the resulting context aligns with a valid, volatility filtered FVG and a clearly defined breaker range.
Each detected setup is drawn directly on the chart with labeled zones (Breaker and FVG) and is then actively monitored. If price violates the breaker boundary based on your chosen invalidation basis (Close or Wick), the setup is marked inactive and can optionally be removed to keep the chart clean.
This indicator is designed for traders who work with ICT style concepts such as liquidity runs, displacement, breaker blocks, and imbalance reversion, and who want a structured, rules based visualization rather than discretionary drawing.
🔹 Features
🔸 Fair Value Gap Detection With Volatility Filtering
Bullish and bearish FVGs are detected using classic three candle imbalance logic. To avoid low quality gaps during compression, the script applies an ATR based minimum size filter using the “FVG Min Size (ATR Multiplier)” input. Only gaps larger than ATR * threshold are considered valid.
🔸 First Break Validation (Clean Break Logic)
A key part of the model is identifying a “first break” of a swing level. The script checks whether the swing price has already been invalidated between the swing bar and the current bar. If it has, the swing is ignored. This helps reduce repeated signals and focuses on fresh structural breaks.
🔸 Breaker and FVG Confluence With Overlap Requirement
After a valid break occurs, the script defines a breaker range using the body of the swing candle (open and close). A setup is only created if this breaker body range overlaps the detected FVG price range. This overlap requirement is what filters many “almost” conditions and keeps signals more selective.
Bullish Unicorn:
Bearish Unicorn:
🔸 Configurable Invalidation Basis (Close or Wick)
You can choose how a setup fails:
-Close: invalidation requires a candle close beyond the breaker boundary
-Wick: invalidation occurs as soon as any wick crosses beyond the breaker boundary
This allows the tool to adapt to different trading styles, from conservative confirmation to more sensitive risk control.
🔸 Automatic Cleanup of Failed Setups
If “Delete Invalidated Setups” is enabled, the script removes the breaker box, FVG box, and label as soon as the setup is invalidated. If disabled, the zones remain visible for review while the setup is marked inactive internally.
🔸 Clear Chart Visuals
Each setup plots:
-A labeled Breaker zone box
-A labeled FVG zone box
-A directional Unicorn label (Bull or Bear) that updates position as the chart advances
Colors for bullish and bearish structures are fully configurable.
🔸 Alert Conditions
Two alert conditions are provided:
-Bullish Unicorn Setup Detected
-Bearish Unicorn Setup Detected
Alerts trigger only on the bar a new setup is created.
🔹 Calculations
This section summarizes the main computations used internally. The goal here is to explain the model mechanics rather than reproduce every implementation detail.
1. Swing Detection (Pivot High / Pivot Low)
Swing levels are detected using a symmetric pivot definition with “Swing Length” bars on both sides:
float ph = ta.pivothigh(high, swingLength, swingLength)
float pl = ta.pivotlow(low, swingLength, swingLength)
When a pivot is confirmed, its price and originating bar index are stored:
-Swing High: price = pivot high, isHigh = true
-Swing Low: price = pivot low, isHigh = false
The script keeps a limited history (most recent swings) to stay efficient.
2. Fair Value Gap Detection
FVGs use the classic three candle displacement imbalance:
Bullish FVG condition
bool isBullFVG = high < low
Bullish gap range is defined as:
-Top = low
-Bottom = high
Bearish FVG condition
bool isBearFVG = low > high
Bearish gap range is defined as:
-Top = low
-Bottom = high
3. ATR Based Minimum Gap Filter
ATR is computed (length 14), then the gap size is compared against a user threshold:
float atr = ta.atr(14)
bool validBullFVG = isBullFVG and (bullFvgTop - bullFvgBot) > (atr * fvgThreshold)
bool validBearFVG = isBearFVG and (bearFvgTop - bearFvgBot) > (atr * fvgThreshold)
This prevents very small imbalances from generating setups in low volatility conditions.
4. “First Break” Check Using Level Invalidation Scan
Before accepting a swing break, the script scans forward from the swing bar to the current bar to confirm the level has not already been breached. The scan can be based on wick or close:
-Wick mode: uses high or low
-Close mode: uses close
Conceptually:
priceToCheck = mode == "Wick" ? (checkBelow ? low : high) : close
If a prior breach is found, the swing is treated as already invalidated and is ignored for setup creation.
5. Break Of Structure Condition
Bullish break requirement
A bullish setup requires breaking a stored swing high with bullish body intent:
-close > swingHighPrice
-open < close
Bearish break requirement
A bearish setup requires breaking a stored swing low with bearish body intent:
-close < swingLowPrice
-open > close
An additional proximity filter is applied in the bearish branch to reduce weak or overly extended breaks by requiring the prior close to be reasonably near the swing level.
6. Breaker Range Construction
Once a qualifying swing is found, the breaker range is derived from the body of the swing candle (the candle at the swing bar index). The body boundaries are:
float breakerTop = math.max(bOpen, bClose)
float breakerBot = math.min(bOpen, bClose)
This models the breaker as the candle body range rather than full wick range, which typically produces more practical invalidation boundaries.
7. Overlap Test Between Breaker and FVG
A setup is only created if the breaker body overlaps the FVG zone. Conceptually the script rejects cases where one range is fully above or fully below the other:
-If there is no overlap, no setup is created
-If overlap exists, the Unicorn setup is valid
8. Active Monitoring and Invalidation
Each setup remains active until invalidated. Invalidation is evaluated every bar using your selected basis:
-Close basis: compares close to breaker boundary
-Wick basis: compares high or low to breaker boundary
Bullish invalidation
Setup fails if price crosses below breaker bottom.
Bearish invalidation
Setup fails if price crosses above breaker top.
If deletion is enabled, all drawings related to that setup are removed immediately on invalidation.
9. Drawing Updates and Object Lifecycle
Breaker and FVG boxes are extended to the right while the setup is active to keep zones visible into the near future. The Unicorn label is also repositioned as new bars print so the most recent context stays readable.
Unicornmodel
ICT Unicorn | Flux Charts💎 GENERAL OVERVIEW
Introducing our new ICT Unicorn Indicator! This indicator is built around the ICT's "Unicorn" strategy. The strategy uses Breaker Blocks and Fair Value Gaps for entry confirmation. For more information about the process, check the "HOW DOES IT WORK" section.
Features of the new ICT Unicorn Indicator :
Implementation of ICT's Unicorn Strategy
Toggleable Retracement Entry Method
3 Different TP / SL Methods
Customizable Execution Settings
Customizable Backtesting Dashboard
Alerts for Buy, Sell, TP & SL Signals
📌 HOW DOES IT WORK ?
The ICT Unicorn entry model merges the concepts of Breaker Blocks and Fair Value Gaps (FVGs), offering a distinct method for identifying trade opportunities. By integrating these two elements, we can have a position entry with stop-loss and take-profit targets on the potential support & resistance zones. This model is particularly reliable for trade entry, as it combines two powerful entry techniques.
An ICT Unicorn Model consists of a FVG which is overlapping with a Breaker Block of the same type. Here is an example :
When a FVG overlaps with a Breaker Block of the same type, the indicator gives a Buy or Sell signal depending on the FVG type (Bullish & Bearish). If the "Require Retracement" option is enabled in the settings, the signals are not given immediately. Instead, the current price of the ticker will need to touch the FVG once more before the signals are given.
After the Buy or Sell signal, the indicator immediately draws the take-profit (TP) and stop-loss (SL) targets. The indicator has three different TP & SL modes, explained in the "Settings" section of this write-up.
You can set up alerts for entry and TP & SL signals, and also check the current performance of the indicator and adjust the settings accordingly to the current ticker using the backtesting dashboard.
🚩 UNIQUENESS
This indicator is an all-in-one suit for the ICT's Unicorn concept. It's capable of plotting the strategy, giving signals, a backtesting dashboard and alerts feature. Different and customizable algorithm modes will help the trader fine-tune the indicator for the asset they are currently trading. Three different TP / SL modes are available to suit your needs. The backtesting dashboard allows you to see how your settings perform in the current ticker. You can also set up alerts to get informed when the strategy is executable for different tickers.
⚙️ SETTINGS
1. General Configuration
FVG Detection Sensitivity -> You may select between Low, Normal, High or Extreme FVG detection sensitivity. This will essentially determine the size of the spotted FVGs, with lower sensitivies resulting in spotting bigger FVGs, and higher sensitivies resulting in spotting all sizes of FVGs.
Swing Length -> Swing length is used when finding order block formations. Smaller values will result in finding smaller order & breaker blocks.
Require Retracement ->
a) Disabled : The entry signal is given immediately once a FVG overlaps with a Breaker Block of the same type.
b) Enabled : The current price of the ticker will need to touch the FVG once more before the entry signal is given.
2. TP / SL
TP / SL Method ->
a) Unicorn : This is the default option. The SL will be set to the lowest low of the last 100 bars with an extra offset in a Buy signal. For Sell signals, the SL will be set to the highest high of the last 100 bars with an extra offset. The TP is then set to a value using the SL value and maintaining a risk-reward ratio.
b) Dynamic: The TP / SL zones will be auto-determined by the algorithm based on the Average True Range (ATR) of the current ticker.
c) Fixed : You can adjust the exact TP / SL ratios from the settings below.
Dynamic Risk -> The risk you're willing to take if "Dynamic" TP / SL Method is selected. Higher risk usually means a better winrate at the cost of losing more if the strategy fails. This setting is has a crucial effect on the performance of the indicator, as different tickers may have different volatility so the indicator may have increased performance when this setting is correctly adjusted.

