Liquidity Side Bias Engine [AGPro Series]Liquidity Side Bias Engine
🧠 Core Idea
Which side of resting liquidity is the more likely near-term draw right now: the buy-side above, or the sell-side below?
This script is built to answer that one question with structure instead of guesswork.
📌 Overview / What It Does
Liquidity Side Bias Engine is a forward-looking, two-sided liquidity planner for smart-money and ICT-style analysis. Most price action leaves resting liquidity on both sides of the market: buy-side liquidity above old highs and equal highs, and sell-side liquidity below old lows and equal lows. At any moment, one of those two sides usually has the stronger pull. This tool maps the nearest untapped liquidity on each side and weighs it into a single, readable side lean.
Concretely, it identifies the closest buy-side pool above price and the closest sell-side pool below price from equal-highs and equal-lows clusters, the prior higher-timeframe high and low, and unmitigated swing points. It then scores each side from 0 to 100 using proximity, pool strength, trend context, and premium-discount range position, and reports which side is leaning, by how much, where the primary draw sits, and which opposite level would flip the read.
It does NOT predict price, generate buy or sell signals, or automate trades. It organizes a two-sided liquidity picture into a structured bias so the chart is easier to read and plan around. Every output is analytical context, not a recommendation.
🎯 Purpose & Design Philosophy
Liquidity tools usually fall into two buckets: reactive sweep detectors that mark a liquidity grab after it already happened, and static maps that draw every pool on the chart and leave interpretation entirely to the trader. Both are useful, but neither answers the practical question a planner actually asks before the move: of the two sides, which one is the market more likely leaning toward next?
This engine was built to fill that gap. It is for the trader who already understands liquidity but wants a clean, consistent way to frame the two-sided picture without manually weighing five different factors on every chart. It supports a patient, context-first mindset: read the lean, understand why it leans, watch the primary draw and the flip level, and let broader market context confirm or deny the idea. The goal is intentional, structured thinking, not a shortcut around it.
⚡ Why This Script Is Different
Most liquidity tools focus on what already happened, marking sweeps and grabs after the candle closes, or they paint a dense map of every pool and stop there.
This script does NOT try to call tops and bottoms, does NOT fire trade signals, and does NOT bury the chart in unlabeled levels.
Instead, it looks forward. It treats buy-side and sell-side liquidity as a two-sided tug-of-war and resolves it into one lean score from 0 to 100, with a clear dominant side, a primary draw target, an opposite flip level, the pool type in play, and a premium-discount range read. The leaning side is drawn solid and emphasized; the opposite side is drawn faint as the flip reference. The result is a single, calm decision-support read instead of a wall of levels or a backward-looking alert.
⚙️ Methodology
1. Context Detection
An ATR baseline, an EMA trend backbone with a slope check, and a premium-discount dealing range are computed to describe the current environment.
2. Reference Mapping
The nearest untapped buy-side pool above price and sell-side pool below price are located from equal-highs and equal-lows clusters, the prior higher-timeframe high and low, and unmitigated swing points. The prior period adapts to the chart: prior day on intraday, prior week on daily, prior month on higher timeframes.
3. Reaction Evaluation
Each side is scored from 0 to 100 across four factors: proximity (closer pools pull more), pool strength (cluster size, prior-period magnetism, freshness), trend context (the direction-aligned side is weighted), and range position (discount weights the buy-side draw, premium weights the sell-side draw). The two scores are compared into a single lean; a small balance gap is treated as two-sided.
4. Visual Output
The leaning side, its primary draw, the opposite flip level, pool type, distance, and a next-action read are rendered into a clean panel, two side lines, a centered bias badge, and moderate alternating event labels.
🗺️ How to Read the Chart
- Side lines: the buy-side line sits above price, the sell-side line below. The leaning side is solid and bold; the opposite side is faint and dashed, marking the flip reference.
- Bias badge: a compact badge near current price shows the leaning state and its 0-100 score.
- Target tag: a single right-edge tag marks the primary draw price on the leaning side.
- Faint pool lines: lighter dotted lines show other untapped pools as a soft liquidity map.
- Labels: green relates to buy-side context, pink to sell-side context, amber to balanced.
- Panel: a fixed readout of state, bias score, primary draw, pool type, range, flip level, and action.
🚦 Signals & States
- Buy-Side Lean → buy-side liquidity above is currently the leaning near-term draw.
- Sell-Side Lean → sell-side liquidity below is currently the leaning near-term draw.
- Balanced → both sides are close in score; no clear leaning side.
- Buy-Side Taken / Sell-Side Taken → a liquidity side was traded through (mitigated).
These are interpretive states, not instructions. A Buy-Side Lean does not mean buy; it means the upside pool is the weighted draw in the current context.
🔔 Alerts Logic
Three optional alerts are available:
- Buy-Side Lean: triggers when the dominant side flips to buy-side above the active threshold.
- Sell-Side Lean: triggers when the dominant side flips to sell-side above the active threshold.
- Liquidity Side Taken: triggers when a buy-side or sell-side pool is traded through.
Alerts are attention markers that point you back to the chart for context. They are not trade instructions and carry no guarantee of any outcome.
🧩 Confluence Logic
The lean is itself a confluence read. When proximity, pool strength, trend alignment, and range position agree on one side, that side scores higher and the lean is more pronounced. When they disagree, the score stays moderate and the state may resolve to Balanced, which is information in itself: the two-sided picture is unresolved.
📊 When to Use
- Trending markets, to frame whether the trend-aligned liquidity remains the dominant draw.
- Ranging markets, to read which range extreme is the more likely draw from the current premium-discount position.
- Around prior-period highs and lows, to gauge which side carries the stronger pull.
- As a planning overlay alongside your own structure, entries, and risk framework.
⚠️ When NOT to Use
- In very low-liquidity symbols or sessions, where swing points and pools are unreliable.
- In extremely noisy or news-driven conditions, where levels are violated erratically.
- As a standalone entry trigger, or in isolation from market structure and risk context.
- On data with large gaps or thin history, where pool detection has too little to work with.
🎛️ Key Inputs
- Swing Strength: how strong a swing must be to qualify as a pool. Higher keeps only major swings.
- Pool Memory: how many recent swings are retained per side.
- Equal Level Tolerance: ATR width for grouping nearby levels into an equal-highs or equal-lows cluster.
- Use Prior-Period Pools: includes the adaptive prior-period high and low as pools.
- Trend Backbone EMA and Slope Bars: define the directional context weighting.
- Premium-Discount Range: lookback for the dealing range that drives the range-position factor.
- Max Draw Distance, Pool Freshness Window: shape how distance and age affect the score.
- Active Bias Score and Balanced Gap: thresholds for an active lean versus a balanced read.
- Visual, label, and panel controls: side lines, badge, target tag, pool map, label density, panel location, theme, and font size.
🖥️ Interface & Visual Design
The panel is the primary readout, leading with the leaning state and 0-100 score, then primary draw, pool type, premium-discount range, flip level, and a concise action line. On the chart, visual hierarchy favors the leaning side: it is solid and emphasized, while the opposite side stays faint. Labels are kept moderate and strictly alternating so the chart reads cleanly at a glance. Panel location, theme, and font size are adjustable; the panel is shown by default for readability.
🧪 Practical Usage Workflow
1. Read the panel: note the leaning state and the bias score.
2. Check the primary draw and the flip level: where is the weighted draw, and what would invalidate the read.
3. Read the premium-discount range line: is price in discount or premium, and how far is the draw in ATR.
4. Confirm with your own market structure, higher-timeframe context, and risk framework before any decision.
🔍 Interpretation Guidelines
Think of the lean as a weighted opinion about the two-sided liquidity picture, not a forecast. A higher score means the factors agree more strongly; a moderate score or a Balanced state means the picture is mixed and patience is warranted. The flip level is a structural reference, not a hard line. Always interpret the lean inside the broader market context rather than in isolation.
🚫 What This Script Is NOT
- It is NOT a prediction engine and does not forecast price direction.
- It is NOT financial advice or a recommendation to buy or sell.
- It is NOT an automated trading system.
- It does NOT produce guaranteed signals or outcomes.
⚠️ Limitations & Transparency
Outputs depend on detected swing structure and may differ across timeframes and symbols. Volatility, liquidity, and changing market conditions affect how pools form and how they are taken. Prior-period pools rely on higher-timeframe data and shift as new periods print. The tool describes current structure; it cannot know the future, and any level can be exceeded or fail to be reached.
🧠 Market Context Notes
Liquidity tends to rest where many participants place stops and pending orders: above equal highs, below equal lows, and around prior-period extremes. In an uptrend, price in discount often leans toward the buy-side draw above; in a downtrend, price in premium often leans toward the sell-side draw below. This engine encodes that two-sided logic into a single read, but market context always has the final word.
🧾 Use Case Examples
- Price is in discount within its range, trend is up, and the nearest buy-side pool is a prior-week high: the engine shows a Buy-Side Lean with the prior-week high as the primary draw.
- Price is in premium, momentum is fading, and equal lows rest below: the engine may show a Sell-Side Lean with those equal lows as the primary draw and a high above as the flip level.
- Both sides score closely: the engine reports Balanced, signaling an unresolved two-sided picture.
🧱 System Philosophy
This tool reflects the AGPro Series approach: convert a familiar but messy concept into a calm, structured, decision-support read. Liquidity is everywhere on a chart; the value is in organizing it into a single, honest lean that respects the trader's own judgment rather than replacing it.
🔐 Non-Promise Statement
This script makes no promise of profit, accuracy, or any specific result. It is an analytical and organizational tool. No certainty is offered or implied.
📉 Risk Disclosure
Trading involves substantial risk, and most participants can lose money. This script is provided for educational and analytical purposes only and does not constitute financial advice. All decisions, positions, and outcomes remain entirely your own responsibility. Always manage risk and trade within your own plan.
📚 Educational Note
Used as intended, the engine can sharpen how you think about two-sided liquidity: where it rests, which side is weighted, and what would change the picture. Treat it as a lens for structured analysis, and keep building your own market understanding alongside it.
Indicatore Pine Script®






















