Internal and External LiquidityThis 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. Indicator

ScaleValidator🛡️ ScaleValidator Library - Input Validation for PineScript
📢 ABOUT
ScaleValidator is a lightweight utility library that provides robust input validation for PineScript. It ensures your scripts receive valid arguments and throws helpful runtime errors when they don't.
✨ FEATURES
🛡️ Validation Methods
Validate inputs and throw descriptive runtime errors if invalid:
• isValidLocation() — Validate location strings
• isValidPosition() — Validate position strings
• isValidFormat() — Validate format strings
• isValidPOV() — Validate point-of-view (extend) strings
🔍 Helper Methods
Quick boolean checks without throwing errors:
• isLocationAbove() / isLocationBelow() — Check vertical location
• isPositionAbove() / isPositionCenter() / isPositionBelow() — Check position row
• isPositionLeft() / isPositionRight() — Check position column
💡 USAGE EXAMPLE
//@version=6
indicator("Validator Demo", overlay = true)
import cryptolinx/ScaleValidator/1 as v
// Validate inputs before using them
userPosition = input.string(position.top_center, "Position")
if v.isValidPosition(userPosition)
// Safe to use the position
label.new(bar_index, high, "Valid!",
xloc = xloc.bar_index,
style = label.style_label_down,
textcolor = color.white)
// Quick checks without throwing errors
if v.isPositionAbove(userPosition)
// Position is in top row
plotchar(close, char = "▲", location = location.abovebar)
📊 VALID CONSTANTS REFERENCE
Locations
• location.top — Top of pane
• location.bottom — Bottom of pane
• location.abovebar — Above price bar
• location.belowbar — Below price bar
• location.absolute — Absolute position
Positions (3x3 Grid)
• Top Row: top_left, top_center, top_right
• Middle Row: middle_left, middle_center, middle_right
• Bottom Row: bottom_left, bottom_center, bottom_right
Formats
• format.inherit — Inherit from parent
• format.percent — Percentage format
Point of View (Extend)
• extend.both — Extend in both directions
• extend.left — Extend to the left
• extend.right — Extend to the right
🔧 METHOD REFERENCE
Validators (throw runtime error if invalid)
• isValidLocation(string) → bool
• isValidPosition(string) → bool
• isValidFormat(string) → bool
• isValidPOV(string) → bool
Helpers (return bool, no errors)
• isLocationAbove(string) → bool
• isLocationBelow(string) → bool
• isPositionAbove(string) → bool
• isPositionCenter(string) → bool
• isPositionBelow(string) → bool
• isPositionLeft(string) → bool
• isPositionRight(string) → bool
🚀 WHY USE THIS?
• 🛡️ Defensive Programming — Catch invalid inputs early
• 📖 Helpful Errors — Descriptive messages show valid options
• ⚡ Lightweight — No dependencies, minimal overhead
• 🔗 Companion to ScalesDEV — Used internally by the Scale library
📋 CHANGELOG
✅ Added method badges (helper/validator)
✅ Created reference tables for valid constants
✅ Improved parameter descriptions
✅ Formatted return types
🙏 RELATED LIBRARIES
Check out Scales for building beautiful scale visualizations that use this validator!
Battries included! 🔋Happy coding! 🚀 @cryptolinx for the PulseWire community
Library

Zig Zag+ (Macro + Internal Structure Tool)ZigZag+ (Macro + Internal Structure Tool)
ZigZag+ is a simple tool that helps traders to clearly identify and differentiate between macro and internal market structure, to help you keep your bearings of where you are currently in the overall picture.
It is especially difficult to keep your bearings within the larger structural trend when trading the lower timeframes, where for example, a bearish structural trend on a lower timeframe may simply be a retracement of an overall bullish structural trend on a higher timeframe. This indicator primarily aims to help traders maintain awareness of where they are in relationship to the higher timeframe / 'macro' structural trend, and their most significant swing point highs and lows.
The features of this indicator include:
- 2x Zig Zag lines drawn automatically onto your chart. One which has a longer length than the other, which can be used to help identify and differentiate the larger price swings from the smaller price swings found within it. Enabled by default.
- Customisable Zig Zag line color & width settings to help clearly differentiate the higher timeframe 'macro structure' apart from the lower timeframe 'internal structure' within it, enabling it to be tailored to suit your chart colour theme and personal preference.
- Customisable individual length settings for the 2x Zig Zag lines, to allow the fine tuning of each line to any timeframe and asset. By default one lines length is set to a higher value than the other, to illustrate a macro structure (higher length value) as well as the 'internal structure' (lower value length), seen within the larger macro structure.
- Up to a maximum of 500 lines can be drawn meaning you can zoom out considerably, and view historical price action with both Zig Zag lines continuing to print.
- Custom alerts for identifying candlesticks that can offer optimal entries where they are found within valid price markups or markdowns that are already underway. Further details can be found within the tooltips for these signals.
Note: The above list of features are accurate at the time of publishing, but may be updated or added to in future.
Structure
Understanding structure is arguably the foundation of all trading strategies, and therefore very important to understand where you are exactly in the bigger picture, since it can help identify levels at which there is a higher probability of price moving either upward or downward at a given point. Structural trend refers to the typical way that price tends to move in any given trending market, identified by the continuation of higher highs and higher lows in a typical bullish trending market, and lower highs and lower lows in a bearish trending market.
During other times price may not be trending in this way, for example when it is undergoing accumulation or distribution phases, where the consistent higher high & lower low / lower high and lower low patterns will not be evident.
What is Macro Structure?
Macro trend structure refers to the structural trend seen on higher timeframe charts.
What is Internal Structure?
Internal trend structure refers to the structural trend seen on lower timeframe charts, which is found within the higher timeframe structure.
Disclaimer: This indicator is adapted from an original script authored by Tr0sT . With special thanks. Indicator

Indicator

Indicator

Indicator
