OPEN-SOURCE SCRIPT
ID009 Liquidity Path [ReconHK]

A liquidity-focused chart indicator designed to help traders study whether price is reclaiming or holding above a key liquidity pivot, while also checking structural liquidity, traded activity, trend context, relative volume, and buyer-pressure confirmation.
------------------------------------------------------------------------------------------------
## 1. [Must read as user] What this indicator is for 🧭
------------------------------------------------------------------------------------------------
Liquidity Path is designed to help traders understand whether price is moving through a healthier liquidity area instead of chasing random breakouts. The indicator builds a liquidity profile from the selected lookback period, finds the main activity area, and marks the Liquidity Pivot, also known as the profile point of control.
The main idea is simple: price action near a high-activity area can be more meaningful than price action in a thin or fragmented area. When price reclaims or holds above the Liquidity Pivot with volume, buyer pressure, and trend support, the setup may show a stronger liquidity path.
This indicator is not a buy-or-sell system by itself. It is a decision-support tool for reviewing liquidity structure, participation, and price behavior around the profile pivot.
------------------------------------------------------------------------------------------------
## 2. [Must read as user] What you see on the chart 👀
------------------------------------------------------------------------------------------------
The indicator can show several visual elements:
The blue profile helps the user see where activity is concentrated. Thicker profile areas mean more activity was detected at that price zone. The orange Liquidity Pivot is the key reference level used by the path logic.
When price is above the Liquidity Pivot, the market is trading above the main activity reference. When price is below it, price is trading under that reference and may need a reclaim before the path setup improves.
------------------------------------------------------------------------------------------------
## 3. [Must read as user] How to read the Liquidity Pivot 🟠
------------------------------------------------------------------------------------------------
The Liquidity Pivot is the central level of this indicator. It represents the price area with the strongest smoothed activity inside the selected profile lookback.
A reclaim above the Liquidity Pivot can be useful because it shows that price has moved back above a major activity reference. A hold or retest above the pivot can also be important because it may show acceptance above that area instead of only a short-lived breakout.
The indicator checks whether price is:
This helps separate cleaner liquidity-path situations from late, extended, or weak moves.
------------------------------------------------------------------------------------------------
## 4. [Must read as user] Suggested workflow ✅
------------------------------------------------------------------------------------------------
A practical workflow:
The indicator is most useful when the user wants to study whether price is moving from a high-activity base into a stronger continuation path. It is less useful when the market is illiquid, fragmented, or moving with large gaps and weak participation.
------------------------------------------------------------------------------------------------
## 5. [Must read as user] Risk notes and correct expectations ⚠️
------------------------------------------------------------------------------------------------
This indicator does not guarantee that price will continue higher after reclaiming the Liquidity Pivot. A reclaim can fail, especially during weak market conditions, low-volume moves, news shocks, or broad market selloffs.
Important reminders:
This script does not place trades, manage positions, set stops, or calculate position size. It should be used only as a decision-support tool.
------------------------------------------------------------------------------------------------
## 6. [Optional technical explanation] Script structure and originality
------------------------------------------------------------------------------------------------
Pine Script®
------------------------------------------------------------------------------------------------
## 7. [Optional technical explanation] Structural liquidity filter
------------------------------------------------------------------------------------------------
Pine Script®
------------------------------------------------------------------------------------------------
## 8. [Optional technical explanation] Liquidity profile and pivot calculation
------------------------------------------------------------------------------------------------
Pine Script®
------------------------------------------------------------------------------------------------
# 9. [Optional technical explanation] Liquidity Path signal logic
------------------------------------------------------------------------------------------------
Pine Script®
------------------------------------------------------------------------------------------------
## 10. [Optional technical explanation] Inputs, visuals, alerts, and publication notes
------------------------------------------------------------------------------------------------
Pine Script®
------------------------------------------------------------------------------------------------
## 1. [Must read as user] What this indicator is for 🧭
------------------------------------------------------------------------------------------------
Liquidity Path is designed to help traders understand whether price is moving through a healthier liquidity area instead of chasing random breakouts. The indicator builds a liquidity profile from the selected lookback period, finds the main activity area, and marks the Liquidity Pivot, also known as the profile point of control.
The main idea is simple: price action near a high-activity area can be more meaningful than price action in a thin or fragmented area. When price reclaims or holds above the Liquidity Pivot with volume, buyer pressure, and trend support, the setup may show a stronger liquidity path.
This indicator is not a buy-or-sell system by itself. It is a decision-support tool for reviewing liquidity structure, participation, and price behavior around the profile pivot.
The purpose is to help traders avoid late or weak breakouts by checking whether price is close to the main liquidity pivot and supported by participation.
------------------------------------------------------------------------------------------------
## 2. [Must read as user] What you see on the chart 👀
------------------------------------------------------------------------------------------------
The indicator can show several visual elements:
- Blue liquidity profile: a right-side profile showing where more trading activity happened during the selected lookback.
- Orange Liquidity Pivot: the main profile pivot, based on the highest activity area of the profile.
- Lookback zone: the chart area used to build the liquidity profile.
- EMA 20 and EMA 50: optional trend-context lines.
- Optional bias background: subtle background showing whether price is above or below the Liquidity Pivot.
The blue profile helps the user see where activity is concentrated. Thicker profile areas mean more activity was detected at that price zone. The orange Liquidity Pivot is the key reference level used by the path logic.
When price is above the Liquidity Pivot, the market is trading above the main activity reference. When price is below it, price is trading under that reference and may need a reclaim before the path setup improves.
------------------------------------------------------------------------------------------------
## 3. [Must read as user] How to read the Liquidity Pivot 🟠
------------------------------------------------------------------------------------------------
The Liquidity Pivot is the central level of this indicator. It represents the price area with the strongest smoothed activity inside the selected profile lookback.
A reclaim above the Liquidity Pivot can be useful because it shows that price has moved back above a major activity reference. A hold or retest above the pivot can also be important because it may show acceptance above that area instead of only a short-lived breakout.
The indicator checks whether price is:
- above the Liquidity Pivot,
- not too far above the pivot,
- not too extended from the short-term trend,
- supported by relative volume,
- showing buyer-pressure behavior,
- aligned with the trend filter when enabled.
This helps separate cleaner liquidity-path situations from late, extended, or weak moves.
A reclaim is more useful when it happens near the pivot with participation. A move that is already too far above the pivot may be late and riskier.
------------------------------------------------------------------------------------------------
## 4. [Must read as user] Suggested workflow ✅
------------------------------------------------------------------------------------------------
A practical workflow:
- Start with the default settings.
- Keep Liquidity quality on Balanced for most liquid stocks and crypto.
- Use the blue liquidity profile to see where activity is concentrated.
- Watch the orange Liquidity Pivot as the main reference level.
- Check whether price is reclaiming or holding above the pivot.
- Use the relative volume setting to require real participation.
- Use the trend filter if you want signals to prefer EMA trend alignment.
- Avoid acting when price is already too far above the pivot or too extended from the EMA.
- Use alerts as chart-review reminders, not automatic trade instructions.
- Confirm the setup with your own support, resistance, market structure, news, and risk plan.
The indicator is most useful when the user wants to study whether price is moving from a high-activity base into a stronger continuation path. It is less useful when the market is illiquid, fragmented, or moving with large gaps and weak participation.
------------------------------------------------------------------------------------------------
## 5. [Must read as user] Risk notes and correct expectations ⚠️
------------------------------------------------------------------------------------------------
This indicator does not guarantee that price will continue higher after reclaiming the Liquidity Pivot. A reclaim can fail, especially during weak market conditions, low-volume moves, news shocks, or broad market selloffs.
Important reminders:
- The Liquidity Pivot is a reference level, not a guaranteed support level.
- A path signal is a confirmation event, not a complete trading plan.
- Relative volume can confirm participation, but it does not remove risk.
- Trend alignment can improve context, but trends can reverse.
- Thin or fragmented symbols may produce less reliable readings.
- Always define risk, stop logic, invalidation, and exit planning separately.
This script does not place trades, manage positions, set stops, or calculate position size. It should be used only as a decision-support tool.
Use the indicator to organize your liquidity and participation review. Do not use it as a substitute for risk management.
------------------------------------------------------------------------------------------------
## 6. [Optional technical explanation] Script structure and originality
------------------------------------------------------------------------------------------------
Liquidity Path is an overlay indicator. It is not a strategy.
The script uses:
* indicator(..., overlay = true)
* plot() for the Liquidity Pivot / POC line
* plot() for optional EMA 20 and EMA 50 lines
* bgcolor() for optional bias background
* box.new() for the right-side liquidity profile
* box.new() for the lookback zone
* label.new() for the pivot label
* alertcondition() for signal and pivot events
The script does not use:
* strategy.entry()
* strategy.exit()
* strategy.close()
* automatic order placement
* automatic risk management
The originality of the script is in how it combines several liquidity concepts into one path framework.
The main components are:
1. Structural liquidity filter
2. Continuity check
3. Profile-based Liquidity Pivot
4. Smoothed activity profile
5. Value area calculation
6. Trend context using EMA 20 and EMA 50
7. Relative volume confirmation
8. Buyer-pressure confirmation
9. POC reclaim or retest logic
10. Extension control
11. Path-mode strictness
12. Cooldown control
13. Visual profile and pivot tools
14. Alerts for reclaim, loss, and path signal
These components are not just displayed separately. They work together to answer one practical question:
Is price reclaiming or holding above an important liquidity area with enough structure, volume, trend context, and buyer pressure?
This is what makes the script different from a basic moving-average, volume, or profile-only display.
------------------------------------------------------------------------------------------------
## 7. [Optional technical explanation] Structural liquidity filter
------------------------------------------------------------------------------------------------
The script first checks whether the symbol has acceptable structural liquidity. This helps reduce signals on thin, fragmented, or unreliable markets.
The structural liquidity data is calculated from daily data:
dClose
dOpen
dHigh
dLow
dVol
The script calculates daily dollar volume:
addvD = daily close * daily volume
Then it calculates:
addv20 = 20-period average daily dollar volume
p10Addv20 = 10th percentile of daily dollar volume over the short liquidity window
This means the script does not only check average liquidity. It also checks whether the lower-end liquidity is acceptable. A symbol can have one large-volume day and still be unreliable if many other days are weak.
The script also checks gap behavior:
gapPct = absolute difference between current daily open and prior daily close
gapHit = gap is counted when it is greater than the internal gap threshold
gapFreqPct = percentage of recent days with meaningful gaps
This helps identify symbols that move with frequent gaps instead of continuous trading behavior.
The continuity check uses the selected continuity timeframe:
contTfInput = 30, 60, 120, or 240 minutes
It checks whether volume is missing or zero on that secondary timeframe:
deadBar = continuity timeframe volume equals zero
deadBarPct = percentage of dead bars in the recent window
The script also checks stability:
cvAddv = coefficient of variation of daily dollar volume
rangeFrac = daily range divided by daily close
medRangeFrac = median range fraction
The Liquidity quality setting changes thresholds:
Strict requires higher average dollar volume, stronger lower-percentile dollar volume, fewer dead bars, fewer gaps, lower dollar-volume variation, and lower median range fraction.
Balanced uses medium thresholds and is intended for most liquid stocks and crypto.
Loose allows weaker structure and can produce more signals, but may also accept less reliable symbols.
The script creates:
structAddvOk
structP10Ok
structDeadOk
structGapOk
structCvOk
structRangeOk
The main path setup uses:
structuralQualified = structAddvOk and structP10Ok and structDeadOk
The script also calculates:
structuralRobust = structuralQualified and structGapOk and structCvOk and structRangeOk
This gives the script a liquidity-quality foundation before it evaluates the profile path signal.
------------------------------------------------------------------------------------------------
## 8. [Optional technical explanation] Liquidity profile and pivot calculation
------------------------------------------------------------------------------------------------
The script builds a custom right-side liquidity profile from the selected lookback period.
The profile range is:
highs = highest high over the lookback
lows = lowest low over the lookback
priceRange = highs - lows
The profile is divided into a fixed number of bins:
BINS_COUNT = 120
Each bar in the lookback contributes activity to one price bin using hlc3:
p = hlc3
The script adds volume to the selected bin:
v = volume * weight
The weighting is enabled internally:
weightedInput = true
This means newer bars receive more weight than older bars:
w = 1.0 - i / lookbackInput
This creates a profile that still uses the full lookback but gives more importance to recent activity.
After raw bin activity is built, the script smooths the profile. It loops around each bin and averages nearby bins with distance-based weights. This reduces noise and avoids making the pivot depend too heavily on one single sharp bin.
The script finds the strongest smoothed bin:
maxVol = highest smoothed bin activity
pocIdx = index of strongest bin
pocRaw = price at the center of that bin
This raw pivot is then smoothed:
pocSmoothed = EMA of pocRaw
The final Liquidity Pivot is clamped inside the calculated value area:
pocPrice = clamp(pocSmoothed, value area low, value area high)
The value area is calculated from the POC outward:
1. Start at the POC bin.
2. Add the neighboring bin with more activity.
3. Continue expanding up or down until the selected value-area percentage is reached.
The script calculates:
vah = value area high
val = value area low
The plotted Liquidity Pivot is the final smoothed and clamped POC:
plot(pocPrice, title = "Liquidity Pivot / POC")
This profile design is useful because the pivot is not just the highest raw volume bin. It is smoothed, recent-weighted, and constrained by the internal value area.
------------------------------------------------------------------------------------------------
# 9. [Optional technical explanation] Liquidity Path signal logic
------------------------------------------------------------------------------------------------
The Liquidity Path signal is built from several gates.
First, the script checks where price is relative to the Liquidity Pivot:
abovePocNow = close > pocPrice
belowPocNow = close < pocPrice
Then it measures distance from the pivot:
pocDistancePct = distance between close and pocPrice in percent
This is important because the script tries to avoid late entries. A price that is far above the pivot may already be extended.
The script also measures distance from the fast EMA:
emaDistancePct = distance between close and EMA 20 in percent
The path mode changes strictness:
Early allows more signals and a wider reclaim window.
Balanced uses medium behavior.
Strict requires tighter confirmation.
The script detects:
crossClosePoc = close crosses above the Liquidity Pivot
crossUnderPoc = close crosses below the Liquidity Pivot
It also detects recent reclaim behavior:
barsSinceReclaim
recentReclaim
The reclaim window changes by path mode:
Strict = shorter window
Balanced = medium window
Early = longer window
The script also allows a recent retest:
recentPocRetest
A retest means price recently touched near the Liquidity Pivot but closed back above it. This supports the idea that the pivot may be acting as an accepted liquidity reference.
The POC break-quality check requires:
* price above the pivot
* close meaningfully above the pivot
* high above the pivot
The POC slope check changes by mode:
Strict requires the pivot to be rising recently.
Balanced allows the pivot to be stable or rising over a short comparison.
Early allows a more flexible pivot condition.
The extension filters are:
nearPocPath = price is above POC but not too far above it
notExtendedPath = price is not too far from EMA 20
The trend filter checks:
* EMA 20 above EMA 50
* close above EMA 20
* EMA 20 not falling
This filter can be disabled by the user.
The volume confirmation checks:
* relative volume is not na
* relative volume is above the user threshold
* current volume is above volume moving average
The buyer-pressure confirmation checks:
* bullish candle
* close location value is above the bullish threshold
* delta is improving, or recent buy-share estimate is strong, or price closed above the prior high
The final setup requires:
liquidityPathSetup =
structuralQualified
and price above POC
and POC break quality
and price near POC
and price not extended
and recent reclaim, recent retest, or current reclaim
The final raw path signal requires:
liquidityPathSetup
and trendPathOk
and volumePathOk
and pressurePathOk
and path-mode slope condition
The final signal also uses a cooldown:
pathCooldownBars depends on Early, Balanced, or Strict mode
pathSignal = pathSignalRaw and pathCooldownOk
This makes the signal more selective than a simple POC cross. It must pass liquidity quality, pivot location, extension control, trend context, participation, buyer pressure, and cooldown logic.
------------------------------------------------------------------------------------------------
## 10. [Optional technical explanation] Inputs, visuals, alerts, and publication notes
------------------------------------------------------------------------------------------------
The script includes user inputs grouped into four sections.
Core inputs:
1. Liquidity quality
Controls the structural liquidity filter.
Strict = cleaner but fewer symbols and signals.
Balanced = recommended default.
Loose = more permissive.
2. Continuity timeframe
Secondary timeframe used to check whether trading activity is continuous or fragmented.
3. Use trend filter
When enabled, path signals prefer EMA 20 above EMA 50, close above EMA 20, and non-falling EMA 20.
Liquidity Profile inputs:
4. Profile lookback
Number of bars used to build the blue profile and calculate the Liquidity Pivot.
5. Value area %
Percent of profile activity used to define the value area.
6. Show blue liquidity profile
Displays the right-side profile.
7. Show pivot label
Displays the right-side label for the Liquidity Pivot.
8. Show lookback zone
Highlights the exact chart area used to build the profile.
Liquidity Path inputs:
9. Path signal mode
Early, Balanced, or Strict.
10. Max distance above POC %
Prevents late signals when price is already too far above the pivot.
11. Min RVOL confirmation
Minimum relative volume required for participation confirmation.
Visual inputs:
12. Show EMA lines
Displays EMA 20 and EMA 50.
13. Show PATH labels
This input exists in the current script, but the uploaded version does not show a plotted path label command. If a visible label is intended, a plotshape() or label.new() condition should be added for pathSignal.
14. Show subtle bias background
Optional green or red background based on price above or below the Liquidity Pivot.
15. Pivot name
Custom name shown beside the pivot label.
Visual drawing:
The right-side profile is drawn using boxes. Each box represents one price bin. Wider boxes mean more normalized activity at that price area.
The lookback zone is drawn with a box covering:
* selected lookback bars
* highest high and lowest low of that lookback
The pivot label is drawn on the right side at the current Liquidity Pivot price.
Alerts:
The script includes three alert conditions:
1. Liquidity Path Signal
Triggered when price reclaimed or held above the POC with liquidity, volume, and buyer-pressure confirmation.
2. POC Reclaim
Triggered when price crosses above the Liquidity Pivot.
3. POC Lost
Triggered when price crosses below the Liquidity Pivot.
Important distinction:
* POC Reclaim is a simple pivot-cross event.
* POC Lost is a simple pivot-loss event.
* Liquidity Path Signal is more selective because it requires structural liquidity, pivot position, extension control, trend context, relative volume, buyer pressure, and cooldown logic.
Publication note:
This description explains how the combined parts work together so users do not need to read Pine code to understand the tool. It also clarifies that the script is a liquidity and participation review indicator, not an automated trading strategy.
Open-source transparency note: if any external open-source code, function, or logic was reused, the original author and source should be credited clearly in the publication.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。