What this script is trying to do
Jayadev Rana published Structural Liquidity Matrix for free so traders can understand market structure, liquidity events, order blocks, fair value gaps, and premium-discount context without hiding the logic behind a paywall.
Traders who want smart-money-style context organized clearly on the chart, and buyers who want proof that Jayadev can turn complex ideas into usable Pine Script.
This script brings several smart money concept style tools into one workflow. It tracks both swing and internal pivots, marks BOS and CHoCH breaks, highlights equal highs and equal lows, detects liquidity sweeps, draws bullish and bearish order block zones, and identifies fair value gaps. It can also plot previous day, week, and month highs and lows, show premium/equilibrium/discount areas from the active swing range, color candles by detected trend state, and display a compact dashboard with the current regime and latest event.
How it works
- Swing structure is built from longer confirmed pivots to show the broader market leg. - Internal structure uses shorter pivots to track faster breaks and shifts in character. - When price breaks a confirmed structure level, the script labels the event as BOS or CHoCH. - After qualifying breaks, it searches back for the most relevant bullish or bearish order block and assigns a score before plotting the zone. - Liquidity sweeps are marked when price runs above a prior swing high or below a prior swing low and closes back through that level. - Fair value gaps are detected using a 3-candle imbalance condition and can remain visible until mitigation, depending on user settings. - Previous day, previous week, and previous month highs and lows can be displayed as context levels. - A dashboard summarizes regime, last event, active swing/internal order blocks, and active fair value gaps.
How to use it
- Use swing structure for broader directional context and internal structure for shorter-term shifts. - Use order blocks, fair value gaps, and sweep labels as reaction zones rather than automatic entry signals. - Use the higher-timeframe levels to frame intraday or swing decisions around prior session liquidity. - Use alerts on BOS, CHoCH, equal highs/lows, liquidity sweeps, and FVG detections after bar close confirmation.
Limitations and notes
- Swing and internal structure are based on confirmed pivots, so labels do not appear at the earliest possible bar. - Higher-timeframe levels depend on `request.security()` data from completed higher-timeframe candles. - Order block scoring and gap detection are rule-based filters. They are designed to organize price action, not to prove institutional intent. - This script is a chart-reading and context tool. It does not guarantee future market direction or trading performance.
Credits
This script was independently coded by Jayadev Rana.
Special credit to LuxAlgo for helping popularize smart money concept education and market structure terminology that inspired parts of this script's presentation. This script is not affiliated with or endorsed by LuxAlgo.