OPEN-SOURCE SCRIPT
Liquidity Swing Points [BackQuant]

Liquidity Swing Points [BackQuant]
This tool marks recent swing highs and swing lows and turns them into persistent horizontal “liquidity” levels. These are places where resting orders often accumulate, such as stop losses above prior highs and below prior lows. The script detects confirmed pivots, records their prices, draws lines and labels, and manages their lifecycle on the chart so you can monitor potential sweep or breakout zones without manual redrawing.
What it plots

Each level stores its price, the bar where it was created, its type (high or low), plus a label and a line reference for efficient updates.
How it works
Pivot detection
Level creation
Rendering and extension
Lifecycle management
How it can be used

Why liquidity levels matter
Prior swing points are focal areas where many strategies set stops or pending orders. Price often revisits these zones, either to “sweep” resting liquidity before reversing, or to absorb it and trend. Marking these areas objectively helps frame scenarios like failed breaks, successful breakouts, and retests, and it reduces the subjectivity of eyeballing structure.

Settings to know
Strengths
Practical tips

Limitations and notes
This tool marks recent swing highs and swing lows and turns them into persistent horizontal “liquidity” levels. These are places where resting orders often accumulate, such as stop losses above prior highs and below prior lows. The script detects confirmed pivots, records their prices, draws lines and labels, and manages their lifecycle on the chart so you can monitor potential sweep or breakout zones without manual redrawing.
What it plots
- LQ-H at confirmed swing highs
- LQ-L at confirmed swing lows
- Horizontal levels that can optionally extend into the future
- Timed removal of old levels to keep the chart clean
Each level stores its price, the bar where it was created, its type (high or low), plus a label and a line reference for efficient updates.
How it works
Pivot detection
- A swing high is confirmed when the highest high has swing_length bars on both sides that are lower.
- A swing low is confirmed when the lowest low has swing_length bars on both sides that are higher.
- Pivots are only marked after they are confirmed, so they do not repaint.
Level creation
- When a pivot confirms, the script records the price and the creation bar (offset by the right lookback).
- A new line is plotted at that price, labeled LQ-H or LQ-L.
Rendering and extension
- Levels can be drawn to the most recent bar only or extended to the right for forward reference.
- Label size and line color/transparency are configurable.
Lifecycle management
- On each confirmed bar, the script checks level age.
- Levels older than a chosen bar count are removed automatically to reduce clutter.
How it can be used
- Liquidity sweeps: Watch for price to probe beyond a level then close back inside. That behavior often signals a potential fade back into the prior range.
- Breakout validation: If price pushes through a level and holds on closes, traders may treat that as continuation. Retests of the level from the other side can serve as structure checks.
- Context for entries and exits: Use nearby LQ-H or LQ-L as reference for stop placement or partial-take zones, especially when other tools agree.
- Multi-timeframe mapping: Plot swing points on higher timeframes, then drill down to time entries on lower timeframes as price interacts with those levels.
Why liquidity levels matter
Prior swing points are focal areas where many strategies set stops or pending orders. Price often revisits these zones, either to “sweep” resting liquidity before reversing, or to absorb it and trend. Marking these areas objectively helps frame scenarios like failed breaks, successful breakouts, and retests, and it reduces the subjectivity of eyeballing structure.
Settings to know
- Swing Detection Length (swing_length), Controls sensitivity. Lower values find more local swings. Higher values find more significant ones.
- Bars until removal (removeafter), Deletes levels after a fixed number of bars to prevent buildup.
- Extend Levels Right (extend_levels), Keeps levels projected into the future for easier planning.
- Label Size (label_size), Choose tiny to large for chart readability.
- One color input controls both high and low levels with transparency for context.
Strengths
- Objective marking of recent structure without hand drawing
- No repaint after confirmation since pivots are locked once the right lookback completes
- Lightweight and fast with simple lifecycle management
- Clear visuals that integrate well with any price-action workflow
Practical tips
- For scalping: use smaller swing_length to capture more granular liquidity. Keep removeafter short to avoid clutter.
- For swing trading: increase swing_length so only more meaningful levels remain. Consider extending levels to the right for planning.
- Combine with time-of-day filters, ATR for stop sizing, or a separate trend filter to bias trades taken at the levels.
- Keep screenshots focused: one image showing a sweep and reversal, another showing a clean breakout and retest.
Limitations and notes
- Levels appear after confirmation, so they are delayed by swing_length bars. This is by design to avoid repainting.
- On very noisy or illiquid symbols, you may see many nearby levels. Increasing swing_length and shortening removeafter helps.
- The script does not assess volume or session context. Consider pairing with volume or session tools if that is part of your process.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Check out whop.com/signals-suite for Access to Invite Only Scripts!
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Check out whop.com/signals-suite for Access to Invite Only Scripts!
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。