Order Flow Imbalance Recovery Planner [AGPro Series]Order Flow Imbalance Recovery Planner
🧠 Core Idea
Can a high-volume displacement pocket recover with enough absorption and follow-through to become actionable chart context?
📌 Overview / What it does
Order Flow Imbalance Recovery Planner maps high-volume displacement candles, converts them into practical imbalance recovery pockets, and evaluates whether price can recover that pocket with measurable response.
The script produces imbalance pockets, recovery rails, continuation corridors, invalidation shelves, target reference rails, event labels, and a compact AG Pro dashboard with a 0-100 recovery score.
This script does not read live order book data, footprint data, bid/ask tape, or true exchange-level order flow. It uses chart-available volume, relative volume, candle displacement, wick response, and recovery behavior as a practical visual proxy.
🎯 Purpose & Design Philosophy
The script was built for traders who want a structured way to study volume imbalance recovery instead of reacting to every large candle.
Many displacement candles look important at first, but the useful question is whether price can return to the pocket, absorb pressure, and recover the key rail.
The design supports a context-first workflow: identify the imbalance, observe the test, evaluate the recovery quality, and then read the current state.
⚡ Why This Script Is Different
Most tools mark volume spikes or wide candles as isolated events.
This script does NOT treat every high-volume candle as a signal.
Instead, it builds a recovery pocket, scores the reaction around that pocket, separates test conditions from READY conditions, and keeps invalidation visible.
⚙️ Methodology
1. Context Detection
The script searches for directional displacement candles with elevated relative volume, meaningful candle range, and sufficient body commitment.
2. Reference Mapping
When a valid imbalance is found, the script maps a recovery pocket and a recovery rail around the displacement body.
3. Reaction Evaluation
Price interaction with the pocket is evaluated through retest behavior, close location, wick response, relative volume, freshness, and failure distance.
4. Visual Output
The script displays the active pocket, recovery rail, target rails, invalidation shelf, event labels, bar state color, and dashboard state.
🗺️ How to Read the Chart
Zones represent the active imbalance recovery pocket.
The recovery rail marks the key level price needs to reclaim or lose before the context improves.
Labels highlight new imbalance pockets, pocket tests, ready recovery events, invalidations, and expirations.
Colors:
• Teal = bullish recovery context
• Pink = bearish recovery context or failed context
• Gold = neutral or wait state
• Indigo = monitor or reference state
The panel summarizes imbalance state, recovery score, flow response, risk, and action.
🚦 Signals & States
• Bull Imbalance → a bullish high-volume displacement pocket has been mapped
• Bear Imbalance → a bearish high-volume displacement pocket has been mapped
• Pocket Test → price is interacting with the active imbalance pocket
• Ready Recovery → the recovery score has reached the required threshold
• Invalidated → price has moved beyond the active failure edge
• Expired → the imbalance pocket is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a new imbalance pocket is locked, when price tests the active pocket, when recovery reaches READY status, or when the context is invalidated.
Alerts are attention markers only. They are not trade instructions and do not guarantee future price behavior.
🧩 Confluence Logic
The context becomes stronger when high relative volume, large displacement, clean pocket retest, wick absorption, and recovery close align around the same pocket.
📊 When to Use
• After high-volume displacement candles
• During pullback and recovery phases
• Around breakout continuation attempts
• When studying absorption after aggressive movement
• On liquid symbols with reliable volume data
⚠️ When NOT to Use
• Very low-liquidity markets
• Symbols with unreliable volume data
• Extremely noisy sideways sessions
• News-driven spikes with unstable spreads
• Markets where chart volume does not represent meaningful participation
🎛️ Key Inputs
• Minimum Displacement Range → controls how large a candle must be relative to ATR
• Minimum Body Ratio → filters weak candles with too much wick noise
• Minimum Relative Volume → controls how much volume confirmation is required
• Minimum Ready Score → controls how strict the READY state is
• Projection Bars → controls how far active pockets and rails extend
• Visual Settings → control labels, zones, right-side tags, panel, font size, and bar colors
🖥️ Interface & Visual Design
The dashboard is designed as a quick decision-support panel, not a separate oscillator.
The chart uses a clear hierarchy: pocket first, recovery rail second, labels third, and targets only after recovery context becomes relevant.
The goal is to keep the chart premium, readable, and useful at first glance.
🧪 Practical Usage Workflow
1. Read the panel state
2. Locate the active imbalance pocket
3. Check whether price is testing or recovering the pocket
4. Review the recovery score and risk
5. Compare the output with broader market structure
🔍 Interpretation Guidelines
A READY state means the script has detected enough recovery behavior around the imbalance pocket to mark the context as worth attention.
It does not mean price must continue.
Use the output as structured context together with trend, liquidity, volatility, and higher-timeframe conditions.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a true order book, footprint, or bid/ask delta tool.
It is not an automated trading system.
It does not provide guaranteed signals.
It is not financial advice.
⚠️ Limitations & Transparency
The script uses chart-available data only.
Volume quality differs between markets, brokers, exchanges, and asset classes.
Timeframe changes may alter the appearance and timing of imbalance pockets.
Extreme volatility may produce rapid invalidation or repeated displacement events.
🧠 Market Context Notes
Order-flow style interpretation should always consider liquidity, volatility, structure, and session context.
A strong recovery pocket in a clean trend may carry more practical meaning than the same pocket inside a noisy range.
🧾 Use Case Examples
When price creates a high-volume bullish displacement candle and later retests the pocket, the script evaluates whether the retest shows enough absorption and recovery strength to become a READY context.
When price loses the recovery edge, the script marks invalidation rather than keeping the setup visually alive.
🧱 System Philosophy
AGPro Series tools are designed as decision-support engines.
The goal is not to simplify markets into blind signals, but to organize complex price behavior into readable structure, state, and risk context.
🔐 Non-Promise Statement
No script can provide certainty.
No signal guarantees continuation, reversal, or profit.
Outputs should be interpreted as analytical context only.
📉 Risk Disclosure
Trading involves risk.
Users are responsible for their own decisions, risk management, and trade execution.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use this tool to study how volume displacement, imbalance pockets, absorption, and recovery behavior interact across different markets and timeframes.
Penunjuk Pine Script®






















