Skip to content

Trading rules

You are absolutely right. To program these concepts effectively, you first need a deep, granular understanding of the mechanics behind each one.

Here is the comprehensive breakdown of Absorption, Exhaustion, Stacked Imbalances, and Icebergs, followed by the language-independent logic specifications for Google's Antigravity tool.


Part 1: The Four Pillars of Order Flow Mechanics

This section details the "Physics" of the market—why price moves, why it stops, and how to differentiate between similar-looking but fundamentally different events (like Absorption vs. Exhaustion).

1. ABSORPTION (The "Brick Wall")

  • Definition: Absorption occurs when aggressive market orders (traders attacking the price) are fully consumed by passive limit orders (liquidity providers) without causing the price to move.
  • The Mechanic:
  • Imagine a breakout attempt. Aggressive buyers fire massive Market Buy orders.
  • Normally, this eats through the liquidity at the Ask, causing the price to tick up.
  • In Absorption, a large player (Passive Seller) refreshes their Limit Sell order instantly (or has a massive size sitting there).
  • The Aggressive Buyers spend millions in volume, but the price does not tick up. They are "absorbed."

  • Identification:

  • High Volume: Significant turnover at a single price node.
  • Delta Divergence: Massive positive Delta (buying pressure) but the candle closes Doji or Red (Bearish Absorption). Or massive negative Delta but the candle closes Green (Bullish Absorption).
  • Price Stagnation: The spread does not shift despite the volume.

  • Consequence: The aggressors eventually run out of capital or resolve. Realizing they are trapped, they panic-close their positions (e.g., Buyers sell), causing a sharp reversal away from the wall.

2. EXHAUSTION (The "Empty Tank")

  • Definition: Exhaustion is the absence of trading interest at a specific price level, usually at a new High or Low.
  • The Mechanic:
  • The market pushes to a new High.
  • Unlike Absorption (where there is a war), here, there is simply silence. No one wants to buy these high prices.
  • The aggressive buyers have "run out of gas."
  • The order book might be thin, but no trade occurs because value is not perceived there.

  • Identification:

  • New Extremum: Price makes a new High or Low.
  • Low Volume: Volume drops significantly compared to the previous candles.
  • Delta Fade: Delta approaches zero; there is no aggressive intent.
  • Wicks/Tails: Often results in a candle wick where price ticked up and fell back simply due to lack of support.

  • Consequence: Gravity takes over. Without buyers to prop it up, the price falls back into the previous value area to find liquidity.

3. STACKED IMBALANCES (The "Blitzkrieg")

  • Definition: A specific footprint pattern where aggressive orders overwhelm passive orders diagonally across multiple consecutive price ticks.
  • The Mechanic:
  • Markets trade diagonally (Market Buy at Ask vs. Market Sell at Bid).
  • An Imbalance exists when the volume on the winning side (e.g., Ask) is significantly higher (usually 300%+) than the volume on the losing side (Bid) at the comparison price.
  • "Stacked" means this happens 3 or more ticks in a row. It represents an impulsive, coordinated attack by aggressive traders who sweep through liquidity levels without resistance.

  • Identification:

  • 3+ consecutive price levels with a buy/sell volume ratio > 3:1 (or 4:1).
  • Usually appears in long, full-body candles (Marubozu).

  • Consequence: This creates a "Zone of Interest." If price retraces to this zone later, it often acts as strong Support (for Buy Imbalances) or Resistance (for Sell Imbalances) because the aggressors will defend their entry.

4. ICEBERG ORDERS (The "Camouflage")

  • Definition: A large Limit Order that is split into smaller visible portions to hide the total size from other market participants.
  • The Mechanic:
  • An institution wants to buy 10,000 contracts but doesn't want to spook the market.
  • They place an Iceberg with a "Visible Size" of 100 contracts.
  • As sellers hit the bid and consume the 100, the algorithm instantly "reloads" another 100 from the reserve.
  • To the tape reader, it looks like small size, but the level never breaks.

  • Identification:

  • Time & Sales vs. DOM: The DOM shows only 100 liquidity, but Time & Sales shows 5,000 executed.
  • Math: Executed Volume > Visible Liquidity.

  • Consequence: Acts as a hidden support/resistance. Once the Iceberg is finally finished (all 10,000 filled), the price often snaps quickly in the direction of the break (Liquidty Vaccum) OR reverses sharply if the Iceberg holder successfully defended the level.


Part 2: Logic Specifications for Antigravity

These instructions are designed for a logic-building tool. They define the input variables, the processing logic, and the boolean output triggers.

Global Variables (Inputs)

  • CurrentPrice: Real-time price.
  • AskVol: Volume traded at Ask.
  • BidVol: Volume traded at Bid.
  • TotalVol: AskVol + BidVol.
  • Delta: AskVol - BidVol.
  • AvgVol: Moving average of volume (last n bars).
  • TimeAndSales_Vol: Cumulative volume executed at a specific price level.
  • DOM_Size: Resting limit order size at a specific price level.

Logic Block 1: DETECT_ABSORPTION

  • Trigger Condition:
  • Volume Check: TotalVol > AvgVol * 1.5 (High Effort).
  • Movement Check: CandleRange (High - Low) < AverageRange * 0.5 (Low Result).
  • Directional Check (Bullish Example):
  • Delta is Negative (Aggressive Sellers).
  • Price is at Support OR Low of Day.
  • Close >= Open (Sellers failed to push price down).

  • Output: Boolean IsAbsorption = TRUE.

  • Visual: Draw Box around price cluster. Set Opacity based on Volume intensity.

Logic Block 2: DETECT_EXHAUSTION

  • Trigger Condition:
  • Structure Check: CurrentHigh > PreviousHigh (New Extreme).
  • Volume Check: TotalVol < AvgVol * 0.5 (Low Interest).
  • Delta Check: Abs(Delta) < AvgDelta * 0.3 (No aggression).
  • Shape Check: Close < High (Wick created).

  • Output: Boolean IsExhaustion = TRUE.

  • Visual: Draw "X" or Warning Icon above Candle High.

Logic Block 3: DETECT_STACKED_IMBALANCE

  • Trigger Condition:
  • Loop: Iterate through price levels inside the finished candle.
  • Ratio Calc:
  • BuyRatio = AskVol(P) / BidVol(P-1).
  • SellRatio = BidVol(P) / AskVol(P+1).

  • Threshold: Ratio > 3.0 (300% Imbalance).

  • Stack Count: Check if Threshold is met for P, P+1, and P+2 (3 consecutive levels).

  • Output: List<Price> ImbalanceZone.

  • Visual: Extend horizontal zone from these price levels to the right.

Logic Block 4: DETECT_ICEBERG

  • Trigger Condition:
  • Snapshot: Record DOM_Size at BestBid when price touches it.
  • Accumulator: While CurrentPrice == BestBid, sum TimeAndSales_Vol.
  • The Formula: IF TimeAndSales_Vol > DOM_Size * 1.3 (30% more volume executed than was visible).
  • Reset: Reset accumulator if Price changes tick.

  • Output: Boolean IsIceberg = TRUE at PriceLevel.

  • Visual: Display Circle at Price Level. CircleSize = TimeAndSales_Vol.