OPEN-SOURCE SCRIPT

Iceberg Detector [JOAT]

5 219
ICEBERG DETECTOR [JOAT]

A hidden-liquidity detector that infers iceberg orders from their footprint on the tape — without needing direct L2 data. The detection pattern is well-known to professional tape readers: the same price level being repeatedly tested by long wicks, with above-average volume, and price each time getting rejected back in the opposite direction. That repeated-rejection pattern is the visible signature of an iceberg — a large resting order broken into smaller slices to hide its true size. This script catches the pattern, clusters the tests, paints the zone, and tells you when the iceberg gets broken or eaten.

snapshot

Detection — five gates, all required

A bar is a candidate iceberg test only when every one of these is true:

  • Long wick — wick-to-body ratio above the configurable threshold (default 0.75). The wick is the visible rejection; the body is the failed push.
  • Local extremum — the wick reached a local high or low over the configurable pivot lookback (default 5 bars). A wick that did not actually probe new territory does not count.
  • Above-average volume — bar volume must exceed volume average × multiplier (default 1.0×). Real absorption needs real size hitting the tape.
  • Wick rejection bias — the candle must close in the rejection direction (opposite of the wick).
  • Cluster within tolerance — at least N (default 2) of these qualifying tests must occur within ATR × tolerance of the same level inside the detection window (default 40 bars).


Only when all five gates pass does the script paint a zone. The wick rejection bias % input controls how strict the rejection-direction filter is; raising it to 70%+ makes the zone confirmation slower but cleaner.

Cluster-aware level building

When two or more qualifying tests fall within ATR-multiplier tolerance of each other, they are clustered into a single zone whose vertical extent (configurable in ATR units) covers the cluster. This means an iceberg sitting at 4382.50–4383.25 is rendered as a single horizontal band, not two separate ticks — which is how a real iceberg would actually appear on the tape.

Visual system

  • Iceberg zone — a horizontal band rendered in the cool-blue palette (deep void → pale violet gradient) with configurable opacity.
  • Glow layers — N (configurable, default 4) stacked transparent boxes behind the zone produce a soft glow border.
  • Pulse animation — for a configurable number of bars after a fresh test, the zone's transparency oscillates to highlight that the iceberg has just been re-tested. Toggleable.
  • Test ticks — small markers at each individual test bar inside the zone.
  • Test count badge — small number tag showing how many tests have hit the level.
  • Right extension — configurable bar count for forward zone projection.


A locked Void palette (cool violet gradient on a deep void ground) gives the chart a distinctive hidden-liquidity identity.

Lifecycle — persist, archive, break

Every iceberg has three life stages:

  • Active — currently in front of price and being honoured. New tests add ticks and trigger pulse animations.
  • Broken — price closed through the level by Break Distance × ATR (default 0.5 ATR). The zone moves to the muted broken-archive palette and stays on the chart for brokenStaleBars (default 150) bars so you can see where structure failed.
  • Stale — older than the archive lifetime, automatically removed.


A maximum-concurrent-icebergs cap (default 12 active) and a max-broken cap (default 8) keep the chart legible.

snapshot

Dashboard

Monospaced table, positionable to any of nine corners, surfaces:

  • Active iceberg count, broken count.
  • Nearest iceberg level with side (resistance / support), distance in ticks or %.
  • Test count and age of the nearest iceberg.
  • Last broken event with bars-ago tag.


Alerts

Three alert conditions, each independently controllable:

  • New Iceberg Detected — fires the bar an iceberg is first confirmed (all five gates pass).
  • Iceberg Re-Tested — fires when an existing iceberg gets another qualifying test.
  • Iceberg Broken — fires when price closes through by the break-distance threshold.


How to read it

Two reads, in order of conviction:

  1. Active iceberg in front of price is your immediate liquidity wall. Faded iceberg the market keeps probing without breaking = strong demand-side or supply-side hidden order. Use as a context level — fade touches if your bias is reversal, expect continuation through if your bias is breakout.
  2. Iceberg Broken alert is your highest-conviction directional event. A hidden order has been eaten through, meaning the side that was holding it has either pulled it or been exhausted — either way, the resistance / support is gone, and the move that follows is unencumbered by the absorbed liquidity.


Suggested settings

Defaults (2 minimum tests, 40-bar detection window, 0.5 ATR cluster tolerance, 0.75 wick/body ratio) are tuned for 5m–1H on liquid markets. For lower-timeframe scalping, lower the wick/body ratio to 0.5 and raise the volume multiplier to 1.5×. For higher-timeframe macro reads, raise minimum tests to 3 and widen the detection window to 100+ bars.

Originality

The implementation — the five-gate detection (wick + extremum + volume + rejection % + cluster tolerance), the ATR-cluster level-builder, the cool-palette glow layers, the post-test pulse animation, the break-distance lifecycle with archive, and the test-count badge rendering — is JOAT-original and tuned together. No third-party code reused. The hidden-liquidity / iceberg concept is well-known to tape readers; the detection pipeline here is built specifically for chart-based bar data without requiring L2 access.

Limitations

Pine indicators cannot read L2 order book data. Iceberg Detector infers iceberg presence from the visible tape footprint — long-wick rejection candles, clustered at a level, with above-average volume, all closing in the rejection direction. This is the accepted public-market inference pattern but it is by nature an inference, not a direct observation. The script can produce false positives on instruments with naturally wicky candles and false negatives on instruments where icebergs are filled too quickly to show as multi-bar tests. On low-volume instruments the volume gate may need to be raised to compensate.



Open source- The five-gate detection pipeline, the ATR-cluster level-builder, the post-test pulse compositor, and the lifecycle-with-archive state machine are proprietary. Free to use; behaviour is fully described above.



-made with passion by jackofalltrades

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.