OPEN-SOURCE SCRIPT

Apicode Liquidity Map Proxy v2.1

1 323
Overview

Apicode — Liquidity Map Proxy v2.1 is an institutional-style market structure and liquidity analysis tool designed for traders who want to approximate, inside TradingView, some of the core concepts typically associated with order flow and liquidity platforms such as Bookmap.

Because Pine Script does not have access to the full order book, real bid/ask tape, or true resting liquidity, this indicator does not replicate Bookmap directly. Instead, it focuses on identifying the price and volume footprints that institutional activity often leaves behind.

The script combines multiple concepts into one visual framework:
  • swing-based liquidity levels
  • equal highs and equal lows
  • liquidity sweeps
  • absorption-style candles
  • delta proxy / CVD proxy
  • order blocks
  • fair value gaps
  • previous day high / low
  • Asia, London, and New York session highs/lows
  • high-quality long and short setup alerts

The goal is to help traders identify areas where liquidity is likely concentrated, where stop hunts may occur, and where price reactions are more likely to develop with institutional logic.

What this indicator is built for

This script is especially useful for traders who want to:
  • detect likely liquidity pools
  • identify stop-hunt behavior
  • find reversal or continuation zones
  • combine market structure with volume context
  • reduce chart noise by automatically removing invalidated historical levels
  • receive alerts when higher-quality long or short conditions appear

It is particularly suitable for intraday trading, especially on highly liquid assets such as crypto pairs, indices, or major forex instruments.

Core Features

1. Swing Liquidity Lines

The indicator plots horizontal liquidity levels based on pivot highs and pivot lows. These zones often act as references for:
  • clustered stops
  • breakout attempts
  • liquidity grabs
  • short-term support and resistance

Unlike static historical levels, these lines are automatically cleaned up when they become irrelevant, either because they are too old or because price has already swept through them with sufficient displacement.

2. Equal Highs and Equal Lows

Equal highs and equal lows are important because they often represent obvious liquidity targets.

When the market forms similar highs or lows within a selected tolerance, the script marks them as:
  • EQH = Equal Highs
  • EQL = Equal Lows

These zones can be useful for anticipating where price may move next in search of liquidity.

3. Liquidity Sweeps

A liquidity sweep occurs when price breaks above a prior high or below a prior low and then quickly fails to hold that move.

This script identifies:
  • Sweep High → price takes prior highs and closes back below
  • Sweep Low → price takes prior lows and closes back above

These events can be early signs of manipulation, stop hunting, or failed breakout behavior.

4. Absorption Detection

The script includes an absorption-style candle model based on:
  • volume spike
  • small real body
  • strong wick rejection
  • directional close

This is not true bid/ask absorption, since Pine cannot read the order book, but it is designed to approximate the kind of candle behavior often seen when aggressive market participants are absorbed by passive liquidity.

The script marks:
  • bullish absorption
  • bearish absorption


These signals become much more useful when combined with sweeps and contextual liquidity levels.

5. Delta Proxy and CVD Proxy

Since TradingView cannot access real bid/ask delta for most instruments, this script uses a delta proxy based on candle structure and volume.

It also calculates a CVD-style proxy to estimate directional participation over time.

This helps classify the market as showing:
  • buying pressure
  • selling pressure
  • rising cumulative participation
  • falling cumulative participation

These proxies are used as filters in the long and short setup logic.

6. Order Blocks

The script identifies simplified order blocks based on the last opposite candle before a strong impulse.

A bullish order block is derived from the last bearish candle before an upside impulse.

A bearish order block is derived from the last bullish candle before a downside impulse.

Order blocks are automatically removed when they are mitigated or become too old, helping keep the chart focused on active zones only.

7. Fair Value Gaps (FVG)

The indicator detects simple three-candle fair value gaps:
  • bullish FVG
  • bearish FVG

These areas may act as imbalance zones where price can later react, rebalance, or continue.

Filled or outdated FVGs can be removed automatically to avoid clutter.

8. Previous Day High / Low

Previous day high and previous day low are major liquidity references in many trading models.

These levels often act as:
  • stop clusters
  • breakout traps
  • session targets
  • reversal or continuation zones

The script plots them continuously so traders can immediately see whether price is trading near high-priority liquidity.

9. Session Highs and Lows

The script tracks highs and lows for:
  • Asia session
  • London session
  • New York session

These session ranges are extremely useful in liquidity-based trading because markets often sweep one session’s extreme before moving in the opposite direction or expanding into a new direction.

10. Reaction Boxes

When the script detects a reaction condition such as:
  • sweep + absorption
  • sweep + delta confirmation

it plots a temporary reaction box to visually highlight the zone where price should defend if the reaction is genuine.

This helps traders see potential reaction areas at a glance instead of focusing only on labels.

11. LONG READY / SHORT READY / Quality Setups

The script builds directional setups using context rather than isolated candles.

A basic bullish setup requires:
  • a sweep low
  • reaction confirmation
  • proximity to important liquidity
  • positive delta proxy
  • rising CVD proxy

A basic bearish setup requires:
  • a sweep high
  • reaction confirmation
  • proximity to important liquidity
  • negative delta proxy
  • falling CVD proxy
In addition, the script defines:
  • LONG QUALITY
  • SHORT QUALITY

These are stronger setups that also require a volume spike. They are intended to reduce low-conviction signals and highlight higher-quality opportunities.

Automatic Cleanup Logic

One of the most useful features of v2.1 is that it removes chart objects that are no longer relevant.

This includes:
  • liquidity lines that have been swept or have aged out
  • order blocks that have been mitigated or are too old
  • fair value gaps that have been filled or expired
  • reaction boxes after their active duration ends

This cleanup logic makes the indicator much more practical for live trading, since the chart stays focused on actionable areas instead of accumulating historical noise.

Alerts

The script includes alert conditions for:
  • Bullish Absorption
  • Bearish Absorption
  • Sweep Low
  • Sweep High
  • LONG READY
  • SHORT READY
  • LONG QUALITY
  • SHORT QUALITY
  • Bullish FVG
  • Bearish FVG
  • Bullish Order Block
  • Bearish Order Block

For practical trading, the most useful alerts are usually:
  • LONG QUALITY
  • SHORT QUALITY

These are stricter than the standard ready conditions and generally provide cleaner signals.

Suggested Use

Best use cases

This indicator is best used for:
  • intraday trading
  • liquidity-based trading
  • market structure analysis
  • institutional-style execution models
  • crypto, forex, and liquid index instruments


Recommended timeframes

Suggested starting points:
  • 5m for faster execution and more frequent setups
  • 15m for cleaner structure and lower noise

Suggested Settings for XRPUSDT

For 5-minute charts
  • Swing length: 4–5
  • Sweep lookback: 20
  • Volume spike multiplier: 1.8
  • Delta smoothing: 6
  • Reaction ATR multiplier: 0.50
  • High-quality-only mode: enabled


For 15-minute charts
  • Swing length: 5–6
  • Sweep lookback: 25
  • Volume spike multiplier: 1.6
  • Delta smoothing: 8
  • Reaction ATR multiplier: 0.70
  • High-quality-only mode: enabled

These are starting points only. Traders should adapt values depending on volatility and the instrument traded.

How to Read a Strong Long Setup

A strong bullish setup usually looks like this:

1. Price sweeps below prior lows
2. The sweep occurs near an important liquidity area such as:
  • previous day low
  • Asia low
  • London low
  • New York low

3. A bullish absorption-style candle appears, or delta/CVD shifts bullish
4. The script prints LONG READY or ideally LONG QUALITY

This type of structure suggests that downside liquidity has been taken and price may now be ready to reverse or expand upward.

How to Read a Strong Short Setup

A strong bearish setup usually looks like this:

1. Price sweeps above prior highs
2. The sweep occurs near an important liquidity area such as:
  • previous day high
  • Asia high
  • London high
  • New York high
3. A bearish absorption-style candle appears, or delta/CVD shifts bearish
4. The script prints SHORT READY or ideally SHORT QUALITY

This type of structure suggests that upside liquidity has been taken and price may now be ready to rotate lower.

Important Limitations

This script is a proxy tool, not a real order book or footprint engine.

It does not have access to:

  • full DOM / order book
  • real resting limit orders
  • iceberg orders
  • spoofing detection
  • true bid/ask delta
  • real market-by-market execution data


That means it should be used as a smart price/volume interpretation tool, not as a literal replacement for Bookmap.

Its strength lies in approximating institutional behavior through:

  • structure
  • wick rejection
  • volume expansion
  • imbalance zones
  • session liquidity
  • failed breakouts and sweep reactions


Best Practice

This indicator works best when combined with disciplined execution. It should not be used as a standalone “blind entry” system.

For best results, combine it with:

  • higher timeframe bias
  • risk management
  • clear invalidation levels
  • session awareness
  • confirmation from market structure


The cleanest trades usually come when multiple factors align at the same time.

Disclaimer

This script is for educational and analytical purposes only. It does not provide financial advice, and no indicator can guarantee profitable outcomes. Traders should always test any method carefully and apply proper risk management.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.