PROTECTED SOURCE SCRIPT

Aggressive VS Passive Orders Depletion @MaxMaserati 3.0

58
Aggressive VS Passive Orders Depletion Indicator

Overview
This institutional-grade order flow analysis tool identifies and tracks limit order accumulation zones where significant buy and sell orders are placed in the market. It combines Highest Volume Candle Profile analysishttps://www.tradingview.com/script/x6YPAiCm-High-Volume-Candle-Node-S-R-MaxMaserati/ with Market Structure detection to reveal where institutional traders have positioned their orders, and monitors in real-time whether these orders are being absorbed (depleted) or defended.

Core Concept: Order Block Detection & Depletion
This tool tracks the actual limit orders at key price levels and shows you:

Where institutional orders are placed (Buy Order Blocks vs Sell Order Blocks)
How strong these order zones are (original volume strength as %)
Real-time order flow activity (aggressive buyers vs aggressive sellers)
Depletion status (are the orders being consumed or defended?)


How It Works: Dual-Engine System
Engine 1: Volume Profile Analysis - Point of Control (POC) Detection

Divides price range into 25 horizontal levels (configurable)
Analyzes the last 120 bars (configurable lookback)
Distributes volume across price levels based on where each bar traded
Identifies the Point of Control (POC) - the price level with highest traded volume
Determines market bias: Bullish if price above POC, Bearish if below

Purpose: Shows where the majority of volume has been traded, indicating institutional accumulation zones and fair value areas.
Engine 2: Market Structure Analysis (PHL - Pivot High/Low)

Uses fractal pivot detection (configurable strength)
Identifies swing highs and lows that create market structure
Tracks Break of Structure (BOS) - price breaks recent swing in trend direction
Tracks Market Structure Shift (MSS) - price breaks swing points against trend
Maintains a trailing price at the most recent significant swing point

Purpose: Identifies where smart money is likely defending key structural levels with limit orders.

Key Innovation #1: Dynamic Confluence Zone Detection
When the Volume Profile POC and Market Structure trail price align within a configurable sensitivity threshold (default 1.0%), the indicator creates an Order Block Zone.
The Algorithm:

Monitors both engines continuously
Creates zones ONLY when POC is within X% of the structural swing point
Both engines must agree on the significance of the price level
Optional volume confirmation filter

This dual-confirmation approach filters out weak levels and highlights only the highest-probability zones where institutional orders are likely clustered.
Zone Types:
🟢 Buy Order Blocks (Support) - Created when confluence occurs with price above the zone. Represents accumulated buy limit orders waiting to support price.
🔴 Sell Order Blocks (Resistance) - Created when confluence occurs with price below the zone. Represents accumulated sell limit orders waiting to resist price.

Key Innovation #2: Real-Time Aggressive VS Passive Order Flow Analysis
The indicator performs sophisticated order flow decomposition on each candle that interacts with a zone, separating market activity into distinct categories:
Order Flow Categories:
1. Aggressive Orders - Market orders that consume liquidity

Aggressive Buy Volume: Market buys hitting sell limits (taking offers)
Aggressive Sell Volume: Market sells hitting buy limits (hitting bids)
Marked with (AGG) label when detected
Indicates urgent traders willing to pay the spread

2. Passive Orders - Limit orders adding liquidity

Passive Buy Volume: New buy limits being placed (making bids)
Passive Sell Volume: New sell limits being placed (making offers)
Shows patient traders providing liquidity

3. New Order Flow - Fresh buying/selling pressure

New Buyers: Total new buying activity (aggressive + passive)
New Sellers: Total new selling activity (aggressive + passive)
Net pressure indicator for zone health


Key Innovation #3: Advanced Order Flow Decomposition Algorithm
The indicator uses a proprietary candle analysis formula to separate aggressive from passive orders based on two key metrics:
Key Metrics:

Body Strength = |Close - Open| / (High - Low)
Close Position = (Close - Low) / (High - Low)

Bullish Candle Analysis:
Strong Aggressive Buying (Close Position ≥ 0.8 AND Body Strength ≥ 0.7):
90% aggressive buying, 10% passive selling, 90% new buyers
Moderate Aggressive Buying (Close Position ≥ 0.6 AND Body Strength ≥ 0.5):
70% aggressive buying, 20% passive selling, 80% new buyers, 20% new sellers
Weak Bullish (Close Position ≥ 0.5):
0-30% aggressive buying, 20-30% passive selling, 60% new buyers, 40% new sellers
Very Weak Bullish (Close Position < 0.5):
0% aggressive buying, 40% passive selling, 40% new buyers, 60% new sellers

Bearish Candle Analysis:
Strong Aggressive Selling (Close Position ≤ 0.2 AND Body Strength ≥ 0.7):
90% aggressive selling, 10% passive buying, 90% new sellers
Moderate Aggressive Selling (Close Position ≤ 0.4 AND Body Strength ≥ 0.5):
70% aggressive selling, 20% passive buying, 80% new sellers, 20% new buyers
Weak Bearish (Close Position ≤ 0.5):
0-30% aggressive selling, 20-30% passive buying, 60% new sellers, 40% new buyers
Very Weak Bearish (Close Position > 0.5):
0% aggressive selling, 40% passive buying, 40% new sellers, 60% new buyers

What This Reveals:

High close position + strong body = Aggressive buying overwhelming sellers
Low close position + strong body = Aggressive selling overwhelming buyers
Mid-range close = Battle between buyers and sellers
Small body = Passive orders dominating (limit orders being placed, not filled)


Key Innovation #4: Dynamic Depletion System with Intelligent Thresholds
The indicator adapts depletion thresholds based on zone strength:
High Liquidity Zones (>300% volume strength):
Depletion at 40% consumption - Massive clusters considered broken early because partial depletion indicates institutional withdrawal
Medium Liquidity Zones (150-300% volume strength):
Depletion at 60% consumption - Standard institutional behavior, majority must be consumed
Normal Liquidity Zones (75-150% volume strength):
Depletion at 80% consumption - Retail and smaller institutional zones need near-complete absorption
Low Liquidity Zones (<75% volume strength):
Depletion at 100% consumption - Weak zones must be fully absorbed before marked depleted
Why This Matters:

Strong zones failing early = powerful reversal signal (institutions gave up)
Weak zones holding = hidden strength (more orders being added)
Adaptive logic prevents false signals from fixed thresholds

Depletion Formula:
For Buy Order Zones:
Zone Liquidity % = (Original Buy Volume / Average Volume) × 100
Consumed % = (Sell Volume Absorbed / Average Volume) × 100
If Consumed Volume > Dynamic Threshold → Zone DEPLETED
For Sell Order Zones:
Zone Liquidity % = (Original Sell Volume / Average Volume) × 100
Consumed % = (Buy Volume Absorbed / Average Volume) × 100
If Consumed Volume > Dynamic Threshold → Zone DEPLETED

Key Innovation #5: Absorption Detection & Battle Analysis

The indicator identifies when one side is overwhelming the other using a configurable Absorption Threshold (default 1.5x = 50% more volume).
Battle States for Buy Order Blocks:
New Buyers Dominating (New Buyers > New Sellers × 1.5):
Label: ↑ New Buyers: +X% - Buy orders successfully defended
Sellers Attacking (New Sellers > New Buyers × 1.5):
Label: ↓ Sellers Attack: +X% (AGG) - Sell orders overwhelming the zone
Active Battle (Both active, <1.5x ratio):
Label: Battle: B+X% vs S+Y% - Active two-way order flow
Quiet Zone (Minimal activity):
Label: ↔ Quiet: X% - Zone untested or ignored
Battle States for Sell Order Blocks:
New Sellers Dominating (New Sellers > New Buyers × 1.5):
Label: ↓ New Sellers: +X% - Sell orders successfully defended
Buyers Absorbing (New Buyers > New Sellers × 1.5):
Label: ↑ Buyers Absorb: +X% (AGG) - Buy orders overwhelming the zone
Active Battle (Both active, <1.5x ratio):
Label: Battle: S+X% vs B+Y% - Active two-way order flow
Quiet Zone (Minimal activity):
Label: ↔ Quiet: X% - Zone untested or ignored

The (AGG) Marker:
Appears when aggressive market orders are detected (high body strength + extreme close position). Indicates institutional-sized urgency—someone is willing to pay market price NOW. Often precedes breakouts or strong continuations.
snapshot
Label System Explained
No Label = Untested Zone
When a zone is first created, you see ONLY the colored box with NO label. This means:

Price has NOT yet reached this order block
The limit orders are still pending/resting
The zone is a future area of interest
Labels only appear after first price contact

Label Format (After First Touch):
Line 1: ● XX% Order Type [STATUS]
Line 2: Flow Analysis
Example Labels:
Buy Order Blocks:

● 150% Buy Orders + ↑ New Buyers: +85%
● 150% Buy Orders + ↑ New Buyers: +120% (AGG)
● 150% Buy Orders + Battle: B+45% vs S+38%
● 150% Buy Orders + ↓ Sellers Attack: +95% (AGG)
● 150% Buy Orders [BROKEN] + ↓ Sellers Attack: +95% (AGG)
● 150% Buy Orders [DEPLETED]

Sell Order Blocks:

● 200% Sell Orders + ↓ New Sellers: +110%
● 200% Sell Orders + ↓ New Sellers: +140% (AGG)
● 200% Sell Orders + Battle: S+62% vs B+41%
● 200% Sell Orders + ↑ Buyers Absorb: +88% (AGG)
● 200% Sell Orders [BROKEN] + ↑ Buyers Absorb: +88% (AGG)
● 200% Sell Orders [DEPLETED]

Status Indicators:

[BROKEN] - Price penetrated through the zone
[DEPLETED] - Orders fully consumed, zone exhausted
Gray color - Zone no longer active

Directional Arrows:

↑ - Upward pressure (buyers stronger)
↓ - Downward pressure (sellers stronger)
↔ - Balanced/quiet (low activity)
↗ / ↘ - Mixed battle with bias


Point of Control (POC) Sub-Level Analysis
Each order block contains advanced volume distribution tracking:

Multi-Level Analysis (default 5 levels): Zones subdivided into horizontal price levels
Volume Distribution: Every candle's volume distributed across sub-levels based on price overlap
Buy/Sell Separation: Each level tracks buy vs sell volume independently
Dynamic POC Line: Marks the price level with highest traded volume within the zone
Real-Time Updates: POC adjusts as new volume enters, showing where "fairest price" is migrating
Style Options: Solid, Dashed, or Dotted lines (configurable width 1-5)

POC Trading Significance:

Represents the most accepted price within the order block
Often the best entry price for limit orders (highest liquidity)
POC migration shows whether zone is being "worked higher" or "worked lower"
Breaking through POC often signals zone failure


Key Settings
Volume Profile:

Lookback Period: 120 bars (historical period for POC)
Price Rows: 25 levels (granularity of volume distribution)
Volume Confirmation: Require structure breaks to align with volume bias

Market Structure:

Pivot Strength: 1 (swing detection sensitivity)
Show Trail: Optional trailing price visualization

Confluence Detection:

Sensitivity: 1.0% (distance threshold for POC/Structure alignment)

Lower = Stricter confluence, fewer zones
Higher = More zones detected



Order Flow Analysis:

Show Real-Time Order Flow: Live buyer/seller activity
Show Aggressive Markers: (AGG) labels for market orders
Show Directional Arrows: Price direction indicators (↑↓↔↗↘)
Absorption Threshold: 1.5x (when one side overwhelms the other)

1.5 = 50% more volume needed
2.0 = 100% more (stricter)
1.2 = 20% more (more sensitive)



Visual Options:

Hide Depleted Zones: Auto-remove exhausted blocks
Smart Bar Coloring: Color candles based on signal alignment
Zone Colors: Customize buy/sell colors
Label Text Size: Tiny, Small, Normal, Large

POC Settings:

Show POC Lines: Toggle Point of Control display
POC Analysis Levels: 3-10 levels
Line Width: 1-5 pixels
Line Style: Solid, Dashed, or Dotted


Trading Applications
1. Institutional Order Detection - Identify where large players positioned limit orders using Volume Profile POC + Market Structure confluence
2. Support/Resistance Validation - Dual confirmation filters weak levels, highlights high-probability reversal areas
3. Order Flow Imbalance Trading - Trade in direction of aggressive flow using (AGG) markers, fade zones showing absorption
4. Breakout/Breakdown Confirmation - [BROKEN] and [DEPLETED] statuses validate moves through key levels
5. Liquidity Hunting - Track stop-loss clusters, anticipate stop runs based on depletion patterns
6. Entry Refinement - Use POC lines for precise limit placement at "fairest price" within zones

Combined Signal System
HVN Volume Profile × Market Structure Signals:


STRONG BUY: Both engines bullish + structure break up + volume confirmation
BUY: Bullish bias with partial confirmation
WEAK BUY: Early bullish signals
STRONG SELL: Both engines bearish + structure break down + volume confirmation
SELL: Bearish bias with partial confirmation
WEAK SELL: Early bearish signals

Alert Conditions:

Strong Buy/Sell signals (with volume confirmation)
Confluence zone activation (new order block created)
Order block depletion (zone exhausted)


What Makes This Indicator Unique
Industry-Standard Foundation:
Volume Profile POC detection + Market Structure analysis (swing pivots, BOS/MSS) + Point of Control tracking
Unique Innovations:
Dynamic Confluence Algorithm + Aggressive vs Passive Order Flow Decomposition + Adaptive Depletion Thresholds + Real-Time Absorption Detection + Battle Analysis with (AGG) markers + Complete Unified Methodology
Technical Excellence:
Resource-optimized (max 50 zones), comprehensive safety checks, multi-tier labeling, flexible customization

Best Practices

Wait for first touch - No label = untested zone
Watch (AGG) markers - Institutional urgency signal
Trust adaptive depletion - Strong zones failing early = major reversal
Use POC for entries - Best price within zone
Combine higher timeframes - Daily/4H zones strongest
Respect [BROKEN] zones - Failed support becomes resistance
Follow battle labels - Contested areas show stop clusters
Adjust sensitivity - Tight ranges = lower %, trending = higher %


Performance Notes

Maximum Active Zones: 50 (automatic cleanup)
Maximum Lines: 400 (POC managed dynamically)
Lookback Cap: 1000 bars for optimization
Updates: All calculations on bar close for confirmed signals

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.