PROTECTED SOURCE SCRIPT
Aggiornato (ICT)Liquidity Grab + FVG + MSS/BOS

This script is a comprehensive educational indicator that combines and enhances several well-known trading concepts:
Liquidity Grabs (Swing Failure Patterns)
Fair Value Gaps (FVG)
Market Structure Shifts / Break of Structure (MSS/BOS)
Alerts
It identifies potential bullish and bearish liquidity grabs, confirms them optionally using volume validation on a lower timeframe, and tracks subsequent price structure changes. The indicator visually marks key swing highs/lows, FVG zones, and BOS/MSS levels—allowing traders to observe how price reacts to liquidity and imbalance zones.
🔍 Features:
Swing Failure Patterns (SFP):
Highlights possible liquidity grabs based on recent highs/lows and candle structure.
Volume Validation (Optional):
Filter signals using relative volume outside the swing on a lower timeframe. Adjustable threshold.
Fair Value Gaps (FVG):
Detects imbalance gaps and extends them for easy visualization.
Market Structure (MSS/BOS):
Displays Break of Structure (BOS) and Market Structure Shift (MSS) based on pivot highs/lows and closing conditions.
Dashboard:
A compact info panel displaying lower timeframe settings and validation status.
Custom Styling:
Adjustable colors, line styles, and label visibility for clean charting.
🧠 Ideal For:
Traders studying ICT concepts, smart money theories, and price-action-based strategies who want a visual tool for analysis and backtesting.
How to Use:

Wait for a Liquidity Grab (SFP) to form
The first condition for a potential entry is the formation of a Stop Hunt / Swing Failure Pattern (SFP).
This indicates that liquidity has been taken above or below a key level (e.g., previous high/low), and the market may be ready to reverse.
Confirmation with Fair Value Gap (FVG) and Market Structure Shift (MSS)
After the SFP, do not enter immediately. Wait for confirmation:
FVG: A Fair Value Gap (an imbalance in price action) must appear, signaling potential institutional activity.
MSS: A Market Structure Shift (break in the current trend) confirms a possible trend reversal or strong corrective move.
Enter the trade
Once both the FVG and MSS are confirmed after the SFP, you can safely enter a trade in the direction of the shift.
Alert Feature
The indicator includes an alert system to notify you when all conditions are met (SFP + FVG + MSS), so you can react quickly without constantly watching the chart.
Liquidity Grabs (Swing Failure Patterns)
Fair Value Gaps (FVG)
Market Structure Shifts / Break of Structure (MSS/BOS)
Alerts
It identifies potential bullish and bearish liquidity grabs, confirms them optionally using volume validation on a lower timeframe, and tracks subsequent price structure changes. The indicator visually marks key swing highs/lows, FVG zones, and BOS/MSS levels—allowing traders to observe how price reacts to liquidity and imbalance zones.
🔍 Features:
Swing Failure Patterns (SFP):
Highlights possible liquidity grabs based on recent highs/lows and candle structure.
Volume Validation (Optional):
Filter signals using relative volume outside the swing on a lower timeframe. Adjustable threshold.
Fair Value Gaps (FVG):
Detects imbalance gaps and extends them for easy visualization.
Market Structure (MSS/BOS):
Displays Break of Structure (BOS) and Market Structure Shift (MSS) based on pivot highs/lows and closing conditions.
Dashboard:
A compact info panel displaying lower timeframe settings and validation status.
Custom Styling:
Adjustable colors, line styles, and label visibility for clean charting.
🧠 Ideal For:
Traders studying ICT concepts, smart money theories, and price-action-based strategies who want a visual tool for analysis and backtesting.
How to Use:
Wait for a Liquidity Grab (SFP) to form
The first condition for a potential entry is the formation of a Stop Hunt / Swing Failure Pattern (SFP).
This indicates that liquidity has been taken above or below a key level (e.g., previous high/low), and the market may be ready to reverse.
Confirmation with Fair Value Gap (FVG) and Market Structure Shift (MSS)
After the SFP, do not enter immediately. Wait for confirmation:
FVG: A Fair Value Gap (an imbalance in price action) must appear, signaling potential institutional activity.
MSS: A Market Structure Shift (break in the current trend) confirms a possible trend reversal or strong corrective move.
Enter the trade
Once both the FVG and MSS are confirmed after the SFP, you can safely enter a trade in the direction of the shift.
Alert Feature
The indicator includes an alert system to notify you when all conditions are met (SFP + FVG + MSS), so you can react quickly without constantly watching the chart.
Note di rilascio
//---------------------------------------------------------------------------------------------------------------------}// Alerts
//---------------------------------------------------------------------------------------------------------------------{
bearish_alert_trigger = pivH.confirmed and pivH.active
bullish_alert_trigger = pivL.confirmed and pivL.active
alertcondition(bearish_alert_trigger, title="Bearish Pattern Confirmed", message="Bearish Liquidity confirmed at {{ticker}} on {{interval}}")
alertcondition(bullish_alert_trigger, title="Bullish Pattern Confirmed", message="Bullish Liquidity confirmed at {{ticker}} on {{interval}}")
Note di rilascio
// Enhanced FVG Settings
showBullishFVG = input.bool(true, "Show Bullish FVG", group="Enhanced FVG")
showBearishFVG = input.bool(true, "Show Bearish FVG", group="Enhanced FVG")
fvgBoxLimit = input.int(10, "FVG Display Limit", minval=1, maxval=100, group="Enhanced FVG")
mitigationType = input.string("Close", "Mitigation Type", options=["Close", "Wick"], group="Enhanced FVG")
// Enhanced FVG Colors
bullColor = input.color(color.new(color.green, 90), "Bullish FVG Color", group="Enhanced FVG")
bearColor = input.color(color.new(#534e4e, 90), "Bearish FVG Color", group="Enhanced FVG")
mitigatedColor = input.color(color.new(#787b86, 100), "Mitigated FVG Color", group="Enhanced FVG")
// Enhanced FVG Text Colors
bullTextColor = input.color(color.rgb(121, 114, 114), "Bullish Text Color", group="Enhanced FVG")
bearTextColor = input.color(color.rgb(117, 117, 117), "Bearish Text Color", group="Enhanced FVG")
mitigatedTextColor = input.color(color.rgb(120, 123, 134, 100), "Mitigated Text Color", group="Enhanced FVG")
// Arrays for FVGs
var bullFVGboxes = array.new_box()
var bearFVGboxes = array.new_box()
// FVG Detection Functions
isBullishFVG() => low > high[2] and low[1] <= high[2]
isBearishFVG() => high < low[2] and high[1] >= low[2]
// Mitigation Check Functions
bullishFvgMitigated(boxBottom) =>
mitigationType == "Close" ? close < boxBottom : low < boxBottom
bearishFvgMitigated(boxTop) =>
mitigationType == "Close" ? close > boxTop : high > boxTop
// Mitigation Handling
removeMitigatedBoxes(arrayBoxes, isBearish) =>
i = 0
while i < array.size(arrayBoxes)
boxObj = array.get(arrayBoxes, i)
boxTop = box.get_top(boxObj)
boxBottom = box.get_bottom(boxObj)
mitigated = isBearish ? bearishFvgMitigated(boxTop) : bullishFvgMitigated(boxBottom)
if mitigated
box.set_bgcolor(boxObj, mitigatedColor)
box.set_border_color(boxObj, mitigatedColor)
box.set_text(boxObj, "FVG")
box.set_text_color(boxObj, mitigatedTextColor)
box.set_text_size(boxObj, size.small)
i += 1
else
i += 1
// FVG Creation and Management
if isBullishFVG() and showBullishFVG
fvgBox = box.new(bar_index - 2, low, bar_index, high[2], bgcolor=bullColor, border_color=color.new(bullColor, 50))
box.set_text(fvgBox, "FVG")
box.set_text_color(fvgBox, bullTextColor)
box.set_text_size(fvgBox, size.small)
array.push(bullFVGboxes, fvgBox)
if array.size(bullFVGboxes) > fvgBoxLimit
box.delete(array.shift(bullFVGboxes))
if isBearishFVG() and showBearishFVG
fvgBox = box.new(bar_index - 2, low[2], bar_index, high, bgcolor=bearColor, border_color=color.new(bearColor, 50))
box.set_text(fvgBox, "FVG")
box.set_text_color(fvgBox, bearTextColor)
box.set_text_size(fvgBox, size.small)
array.push(bearFVGboxes, fvgBox)
if array.size(bearFVGboxes) > fvgBoxLimit
box.delete(array.shift(bearFVGboxes))
// Apply Mitigation Checks
removeMitigatedBoxes(bullFVGboxes, false)
removeMitigatedBoxes(bearFVGboxes, true)
// Update Box Positions
updateBoxes(arrayBoxes) =>
if array.size(arrayBoxes) > 0
for i = 0 to array.size(arrayBoxes) - 1
box.set_right(array.get(arrayBoxes, i), bar_index)
updateBoxes(bullFVGboxes)
updateBoxes(bearFVGboxes)
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.