OPEN-SOURCE SCRIPT

Liquidities (Pivot Levels)

1 583
Liquidities — Indicator Guide

Overlay: Yes (liquidity lines, HTF levels, and sweep markers drawn directly on the price chart)

What Is This Indicator?
WO Liquidities with HTF is a liquidity mapping tool that combines two distinct layers of analysis on a single chart. The first layer automatically detects internal liquidity pools — the highs and lows formed by recent price pivots — and tracks whether they have been swept or are still intact. The second layer draws the most significant higher timeframe reference levels: Previous Day High/Low, Previous Week High/Low, Previous Month High/Low, Weekly Open, and Daily Opening price.
Together these two layers give you a complete picture of where liquidity sits on both a micro and macro level, without needing to switch between charts or load multiple separate indicators.

Layer 1 — Internal Liquidity (Pivot Levels)
Internal liquidity levels are identified using pivot highs and pivot lows based on the selected lookback period. These represent areas where stop orders from retail traders accumulate — above swing highs and below swing lows — making them natural targets for institutional price delivery.
How Lines Behave
When a new pivot high is confirmed, a purple line is drawn extending to the right. The line continues extending forward as long as the level has not been touched. This signals that the liquidity above that high is still intact and available to be swept.
When price crosses above the pivot high, the level is considered swept. The line immediately changes to a dotted gray style and stops extending — it becomes a historical record of a consumed liquidity level. If the Sweep Markers option is enabled, a large × symbol appears directly at the sweep point in the original line color, clearly marking the exact bar where the level was taken out.
The same logic applies symmetrically for pivot lows, with a teal/cyan color indicating unswept low liquidity.
What This Tells You
An unswept pivot high above current price is a draw on liquidity — price may be magnetically pulled toward it before reversing. An unswept pivot low below current price serves the same function on the downside. When a level gets swept and the × marker appears, it signals that the liquidity hunt has occurred and a reversal becomes more probable from that point.

Layer 2 — Higher Timeframe Key Levels
Six optional HTF reference levels can be displayed, each drawn as a horizontal line starting from the exact bar where that high or low was formed and extending to the right with a labeled price tag.
PDH — Previous Day High is drawn as a solid orange line. This is the most active intraday reference level and is frequently targeted during the early hours of a new session.
PDL — Previous Day Low is drawn as a dashed orange line. The dashed style distinguishes lows from highs visually at a glance.
PWH — Previous Week High is drawn as a solid red line with width 2. Weekly levels represent major institutional reference points and often act as significant resistance zones.
PWL — Previous Week Low is drawn as a dashed red line with width 2.
PMH — Previous Month High is drawn as a solid green line with width 3. Monthly levels are the widest macro reference levels on the chart and are relevant primarily for swing and position traders.
PML — Previous Month Low is drawn as a dashed green line with width 3.
WO — Weekly Open is drawn as a solid white line marking the price at which the current week opened. This level is commonly used as a bias reference — price above WO suggests a bullish weekly bias and price below suggests bearish.
OD — Opening Day is drawn as a solid teal line marking today's daily open price. This is a key mean-reversion reference — price frequently returns to the daily open before continuing in the session's direction.
All HTF lines are anchored to the exact timestamp where the high or low occurred on the chart, not just drawn from the current bar, giving you accurate visual context for how far price has traveled from those levels.

Settings Reference
Liquidity Settings
Pivot Lookback (default: 15) — the number of bars to the left and right used to confirm a pivot high or low. A higher value means only more significant, wider pivots are detected and labeled as liquidity levels. A lower value creates more frequent but shallower levels. For higher timeframes like 4H or Daily, consider increasing this to 20–30. For scalping on 1-minute or 5-minute charts, values of 5–10 work better.
Levels Visibility
Each of the six HTF levels has its own toggle. Show Daily Levels and Show Weekly Levels are on by default. Show Monthly Levels, Weekly Open, and Opening Day are off by default and can be enabled individually as needed.
Design
Internal High Liquidity Color (default: purple) — color of unswept pivot high lines and their sweep markers.
Internal Low Liquidity Color (default: teal) — color of unswept pivot low lines and their sweep markers.
Broken Level Color (default: muted gray) — color of dotted lines after a level has been swept.
Show Sweep Markers (×) — toggles the large × symbols that appear at the exact point where a liquidity level is taken out. Recommended to keep on as it makes swept levels immediately obvious.
The HTF level colors (Daily, Weekly, Monthly, Weekly Open, Opening Day) are each independently adjustable.

How to Use It — Trading Workflow
Step 1 — Identify unswept liquidity pools. Scan the chart for active purple and teal lines that have not yet been touched. These represent live liquidity targets. Price has a structural tendency to move toward these levels before reversing, especially when they align with HTF reference levels.
Step 2 — Check HTF levels for confluence. Look at whether the nearest unswept internal liquidity sits near a PDH, PWH, or other HTF level. When an internal pivot high coincides with the Previous Week High or Previous Day High, that area becomes a high-priority liquidity zone — the probability of price being drawn there and then reversing is significantly higher.
Step 3 — Watch for the sweep. When price approaches an unswept level, monitor for a wick violation followed by a close back below (for highs) or above (for lows). The × marker will appear automatically when the sweep is confirmed. This is the signal that liquidity has been consumed and a reversal is possible.
Step 4 — Trade the reaction. After the × appears, look for a confirmation entry in the opposite direction. For a swept high, look for a bearish close, a break of recent structure, or a rejection candle to enter short. For a swept low, look for the bullish equivalent. The next unswept level in the opposite direction becomes the natural target.
Step 5 — Use HTF levels as targets and stops. When managing an open trade, use the HTF lines as take profit targets (trade toward the nearest PDH, PWH etc.) and as stop references (if price reclaims above a swept level, the setup is invalidated).

Tips
The most reliable sweeps are those that occur during high-liquidity session windows — London open and New York open. A sweep of PDH or PDL during these windows with a quick rejection is one of the cleanest setups in price action trading.
The Weekly Open level is particularly useful as a bias filter. If price is above WO and sweeps a pivot low during the week, the bullish weekly bias makes the long setup significantly higher probability. Conversely, a sweep of a pivot high while below WO is a strong bearish setup.
Running the indicator on a 15-minute chart with the Pivot Lookback set to 10–15 gives an excellent balance between signal frequency and level significance for intraday trading.

Limitations
Only the most recent pivot high and pivot low are tracked as active internal liquidity levels at any given time — the indicator does not store and display a full history of all unswept pivots simultaneously. HTF levels update at the start of each new Daily, Weekly, or Monthly candle and reflect only the single most recent completed period. Lines are redrawn on the last bar only, which is standard behavior for time-anchored line rendering in Pine Script.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน