OPEN-SOURCE SCRIPT
Internal and External Liquidity

This script is designed to visualize one of the most fundamental concepts in the ICT algorithmic framework: The cycle between Internal and External Liquidity.
According to ICT, the Interbank Price Delivery Algorithm continuously moves price in a loop—from drawing on resting orders at the absolute highs/lows of a dealing range (External Liquidity), back down into inefficiencies within that range (Internal Liquidity), and then back out again.
Here is exactly how the script brings this concept to life on your chart:
1. External Liquidity (The Dealing Range)
To identify the macro boundaries of the current dealing range, the script tracks "Major Swings" (which default to 15-bar pivots).
Ext BSL & Ext SSL: When a major high or low forms, it draws a thick, solid line extending forward in time. This acts as the outer boundary where the heaviest cluster of retail stop losses rests.
2. Internal Liquidity (Minor Swings & FVGs)
Once the dealing range is established, price will often consolidate or retrace within it. The script maps two types of internal liquidity that the algorithm uses to re-price before attacking the external bounds:
Minor Swings: These are short-term highs and lows (default 3-bar pivots) trapped inside the dealing range. They are marked with thinner, dashed lines.
Fair Value Gaps (FVGs): The script automatically highlights active bullish and bearish FVGs with slightly transparent boxes. FVGs act as massive internal magnets for price.
3. Dynamic Mitigation & Sweeps
The true power of this script is that it dynamically updates to reflect real-time liquidity consumption:
If price wicks past an External or Minor Swing line, the line stops extending (because the liquidity has been swept).
If price dips into an FVG box and completely fills the gap, the box immediately stops drawing (because the inefficiency has been rebalanced).
How to use it:
By watching the interplay between these drawings, you can track the algorithmic narrative. For example, if you see price completely fill an internal FVG (Internal Liquidity), you can immediately look up to the thick "Ext BSL" line (External Liquidity) to identify the algorithm's likely next target.
According to ICT, the Interbank Price Delivery Algorithm continuously moves price in a loop—from drawing on resting orders at the absolute highs/lows of a dealing range (External Liquidity), back down into inefficiencies within that range (Internal Liquidity), and then back out again.
Here is exactly how the script brings this concept to life on your chart:
1. External Liquidity (The Dealing Range)
To identify the macro boundaries of the current dealing range, the script tracks "Major Swings" (which default to 15-bar pivots).
Ext BSL & Ext SSL: When a major high or low forms, it draws a thick, solid line extending forward in time. This acts as the outer boundary where the heaviest cluster of retail stop losses rests.
2. Internal Liquidity (Minor Swings & FVGs)
Once the dealing range is established, price will often consolidate or retrace within it. The script maps two types of internal liquidity that the algorithm uses to re-price before attacking the external bounds:
Minor Swings: These are short-term highs and lows (default 3-bar pivots) trapped inside the dealing range. They are marked with thinner, dashed lines.
Fair Value Gaps (FVGs): The script automatically highlights active bullish and bearish FVGs with slightly transparent boxes. FVGs act as massive internal magnets for price.
3. Dynamic Mitigation & Sweeps
The true power of this script is that it dynamically updates to reflect real-time liquidity consumption:
If price wicks past an External or Minor Swing line, the line stops extending (because the liquidity has been swept).
If price dips into an FVG box and completely fills the gap, the box immediately stops drawing (because the inefficiency has been rebalanced).
How to use it:
By watching the interplay between these drawings, you can track the algorithmic narrative. For example, if you see price completely fill an internal FVG (Internal Liquidity), you can immediately look up to the thick "Ext BSL" line (External Liquidity) to identify the algorithm's likely next target.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.