OPEN-SOURCE SCRIPT
Cập nhật Volume Shelf Reaction Map [AGPro Series]

Volume Shelf Reaction Map [AGPro Series]
🔷 OVERVIEW
Volume Shelf Reaction Map is a structural price-action tool that identifies horizontal zones where volume has historically stacked — "volume shelves" — and classifies, in real time, how price reacts each time it returns to them. Instead of showing a static S/R line, it answers a sharper question: when price revisits this level, does it hold, get reclaimed, get rejected, or lose the level entirely? Fresh shelves (never revisited) are visually separated from reused ones, so the chart communicates not just where the levels are, but which ones still carry unused participation behind them.
🧭 UNIQUE EDGE
Most support/resistance and volume tools stop at drawing a zone. This script adds a reaction-state layer on top of shelf detection:
• Five reaction states per shelf: TOUCH, HELD, RECL (reclaimed), REJ (rejected), LOST
• Fresh vs Reused classification — shelves that have already been tested at least once are faded, so untouched structural levels stand out immediately
• Sticky state logic — a shelf keeps its reaction color until a new transition actually occurs, preventing flicker between bars
• Passive-window coloring — shelves whose last reaction is older than the user-defined active window fade to the neutral accent color, keeping old/stale levels visible without dominating the chart
• Strongest-shelf-only reaction tags with cooldown — reaction labels are printed only for the highest-strength shelf and only on actual state transitions, producing a clean chart even on long histories
The result is a volume-aware reaction map rather than a crowded S/R overlay.
🧪 METHODOLOGY
1. Pivot detection — standard pivot highs and lows over a configurable pivot length act as shelf candidates.
2. Volume qualification — each pivot bar is checked against a rolling 20-bar volume average; bars above the Volume Filter multiplier contribute extra weight to shelf strength.
3. ATR-based clustering — candidates within a configurable ATR multiple of an existing shelf are merged using a touches-weighted mean price, stabilizing the shelf location as evidence accumulates.
4. Confirmation — a shelf must reach the Minimum Touches threshold before it is rendered; weak candidates are pruned after one-third of the lookback window.
5. State machine — on every confirmed bar, a shelf's reaction is updated against the prior close's side (support vs resistance context), using an ATR-scaled buffer to distinguish genuine holds and losses from noise.
6. Ranking and rendering — on the last bar, shelves are sorted by strength; only the top N are drawn, with fresh shelves rendered solid and reused shelves rendered thinner and faded.
🔔 SIGNALS & ALERTS
Three alert types, each debounced per shelf so the same state cannot spam consecutive bars:
• Shelf Touched — price range intersects a confirmed shelf for the first time since its last transition
• Shelf Respected — price HELDs, RECLs, or REJs at a shelf (reaction in favor of the shelf)
• Shelf Lost — price closes through a shelf with the required ATR buffer
Reaction tags on the chart (HELD / RECL / REJ / LOST) are printed only for the strongest shelf and only on a true state transition, with a user-adjustable cooldown for historical cleanliness.
⚙️ KEY INPUTS
Shelf Detection
• Lookback Window (bars) — how far back the pivot scan reaches
• Pivot Strength — bars required on each side of a pivot
• Cluster Distance (x ATR) — how tightly nearby pivots merge
• Minimum Touches — confirmation threshold
Filters & Cleanup
• Volume Filter (x average) — participation threshold for strength weighting
• Show Fresh Shelves Only — hide already-revisited shelves
• Max Shelves to Display — cap visible shelves for chart cleanliness
• Fade Reused Shelves — dim reused shelves so fresh ones stand out
• Reaction Sensitivity (x ATR) — ATR buffer used by the state machine
• Active Window (bars) — how recently a reaction must have occurred to show in full color
Visuals
• Label & Panel Size — Tiny / Small / Normal / Large (default: Normal)
• Show Reaction Tags — toggle on-chart state labels
• Tag Cooldown (bars) — minimum bars between tags on the same shelf
Panel
• Show Info Panel, Panel Location (6 anchors), Panel Theme (Dark / Light)
Alerts
• Shelf Touched, Shelf Respected, Shelf Lost
🧰 HOW TO USE
1. Add the indicator to any liquid symbol and timeframe. Volume-aware markets (crypto, index futures, major FX) and timeframes from 15m upward tend to produce the most structured shelves.
2. Start with defaults. The Active Window of 30 bars is a reasonable middle-ground; reduce it on intraday charts (around 20) or raise it on daily/weekly (30–60).
3. Read the panel:
• Active Shelves — how many of the eligible shelves are currently drawn
• Strongest Shelf — the top-ranked shelf by strength
• Current State — live reaction state of the top shelf
• Fresh / Reused — how the displayed shelves split between untested and already-tested levels
4. Use fresh shelves as higher-quality reaction candidates; treat reused shelves as context, not primary triggers.
5. Combine the HELD / RECL / REJ / LOST reactions with your own trigger logic (e.g. break-retest, liquidity sweeps, momentum shifts). This script is a location and reaction tool — not a standalone trade system.
🧱 LIMITATIONS & TRANSPARENCY
• This indicator describes historical structure and live reactions; it does not forecast price direction.
• Pivot-based detection requires the Pivot Strength window to complete on both sides, so fresh pivots appear with a natural lag equal to the pivot length.
• On very low-volume symbols or illiquid timeframes, shelves may be sparse or unstable.
• The state machine is bar-close based; intrabar wicks can temporarily intersect a shelf without changing its state until the bar confirms.
• Max drawing limits (max_lines_count, max_labels_count, max_boxes_count) are set to 120; extremely long histories combined with large lookbacks may drop the oldest drawings.
⚠️ RISK DISCLOSURE
This script is provided for educational and analytical purposes only. It is not a strategy, not a buy/sell signal generator, and not financial advice. Trading involves substantial risk of loss. Past behavior of levels, volume, or reactions does not guarantee future outcomes. Always apply your own risk management, position sizing, and independent judgment. The author and AGProLabs accept no responsibility for decisions made based on this indicator.
🔷 OVERVIEW
Volume Shelf Reaction Map is a structural price-action tool that identifies horizontal zones where volume has historically stacked — "volume shelves" — and classifies, in real time, how price reacts each time it returns to them. Instead of showing a static S/R line, it answers a sharper question: when price revisits this level, does it hold, get reclaimed, get rejected, or lose the level entirely? Fresh shelves (never revisited) are visually separated from reused ones, so the chart communicates not just where the levels are, but which ones still carry unused participation behind them.
🧭 UNIQUE EDGE
Most support/resistance and volume tools stop at drawing a zone. This script adds a reaction-state layer on top of shelf detection:
• Five reaction states per shelf: TOUCH, HELD, RECL (reclaimed), REJ (rejected), LOST
• Fresh vs Reused classification — shelves that have already been tested at least once are faded, so untouched structural levels stand out immediately
• Sticky state logic — a shelf keeps its reaction color until a new transition actually occurs, preventing flicker between bars
• Passive-window coloring — shelves whose last reaction is older than the user-defined active window fade to the neutral accent color, keeping old/stale levels visible without dominating the chart
• Strongest-shelf-only reaction tags with cooldown — reaction labels are printed only for the highest-strength shelf and only on actual state transitions, producing a clean chart even on long histories
The result is a volume-aware reaction map rather than a crowded S/R overlay.
🧪 METHODOLOGY
1. Pivot detection — standard pivot highs and lows over a configurable pivot length act as shelf candidates.
2. Volume qualification — each pivot bar is checked against a rolling 20-bar volume average; bars above the Volume Filter multiplier contribute extra weight to shelf strength.
3. ATR-based clustering — candidates within a configurable ATR multiple of an existing shelf are merged using a touches-weighted mean price, stabilizing the shelf location as evidence accumulates.
4. Confirmation — a shelf must reach the Minimum Touches threshold before it is rendered; weak candidates are pruned after one-third of the lookback window.
5. State machine — on every confirmed bar, a shelf's reaction is updated against the prior close's side (support vs resistance context), using an ATR-scaled buffer to distinguish genuine holds and losses from noise.
6. Ranking and rendering — on the last bar, shelves are sorted by strength; only the top N are drawn, with fresh shelves rendered solid and reused shelves rendered thinner and faded.
🔔 SIGNALS & ALERTS
Three alert types, each debounced per shelf so the same state cannot spam consecutive bars:
• Shelf Touched — price range intersects a confirmed shelf for the first time since its last transition
• Shelf Respected — price HELDs, RECLs, or REJs at a shelf (reaction in favor of the shelf)
• Shelf Lost — price closes through a shelf with the required ATR buffer
Reaction tags on the chart (HELD / RECL / REJ / LOST) are printed only for the strongest shelf and only on a true state transition, with a user-adjustable cooldown for historical cleanliness.
⚙️ KEY INPUTS
Shelf Detection
• Lookback Window (bars) — how far back the pivot scan reaches
• Pivot Strength — bars required on each side of a pivot
• Cluster Distance (x ATR) — how tightly nearby pivots merge
• Minimum Touches — confirmation threshold
Filters & Cleanup
• Volume Filter (x average) — participation threshold for strength weighting
• Show Fresh Shelves Only — hide already-revisited shelves
• Max Shelves to Display — cap visible shelves for chart cleanliness
• Fade Reused Shelves — dim reused shelves so fresh ones stand out
• Reaction Sensitivity (x ATR) — ATR buffer used by the state machine
• Active Window (bars) — how recently a reaction must have occurred to show in full color
Visuals
• Label & Panel Size — Tiny / Small / Normal / Large (default: Normal)
• Show Reaction Tags — toggle on-chart state labels
• Tag Cooldown (bars) — minimum bars between tags on the same shelf
Panel
• Show Info Panel, Panel Location (6 anchors), Panel Theme (Dark / Light)
Alerts
• Shelf Touched, Shelf Respected, Shelf Lost
🧰 HOW TO USE
1. Add the indicator to any liquid symbol and timeframe. Volume-aware markets (crypto, index futures, major FX) and timeframes from 15m upward tend to produce the most structured shelves.
2. Start with defaults. The Active Window of 30 bars is a reasonable middle-ground; reduce it on intraday charts (around 20) or raise it on daily/weekly (30–60).
3. Read the panel:
• Active Shelves — how many of the eligible shelves are currently drawn
• Strongest Shelf — the top-ranked shelf by strength
• Current State — live reaction state of the top shelf
• Fresh / Reused — how the displayed shelves split between untested and already-tested levels
4. Use fresh shelves as higher-quality reaction candidates; treat reused shelves as context, not primary triggers.
5. Combine the HELD / RECL / REJ / LOST reactions with your own trigger logic (e.g. break-retest, liquidity sweeps, momentum shifts). This script is a location and reaction tool — not a standalone trade system.
🧱 LIMITATIONS & TRANSPARENCY
• This indicator describes historical structure and live reactions; it does not forecast price direction.
• Pivot-based detection requires the Pivot Strength window to complete on both sides, so fresh pivots appear with a natural lag equal to the pivot length.
• On very low-volume symbols or illiquid timeframes, shelves may be sparse or unstable.
• The state machine is bar-close based; intrabar wicks can temporarily intersect a shelf without changing its state until the bar confirms.
• Max drawing limits (max_lines_count, max_labels_count, max_boxes_count) are set to 120; extremely long histories combined with large lookbacks may drop the oldest drawings.
⚠️ RISK DISCLOSURE
This script is provided for educational and analytical purposes only. It is not a strategy, not a buy/sell signal generator, and not financial advice. Trading involves substantial risk of loss. Past behavior of levels, volume, or reactions does not guarantee future outcomes. Always apply your own risk management, position sizing, and independent judgment. The author and AGProLabs accept no responsibility for decisions made based on this indicator.
Phát hành các Ghi chú
🔧 UPDATE NOTES - V1.5This update focuses on readability, structure, visual clarity, and usability.
The core purpose of the script remains unchanged.
This release improves how the existing volume shelf reaction logic is presented, organized, and interpreted on the chart.
This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
• Rebuilt the source header and naming structure.
The public script title now follows the current AGPro Series format while the panel title keeps the AG Pro brand presentation.
• Reworked shelf visuals into clearer horizontal zones.
Displayed shelves now use controlled zone boxes, optional midlines, and right-side shelf tags instead of relying only on thin lines.
• Added centered shelf-zone text.
Each displayed shelf can show its active state, touch count, and strength directly inside the zone.
• Improved reaction label control.
Reaction tags are printed only for meaningful state transitions on the strongest eligible shelf, with cooldown and retention controls.
• Rebuilt the panel lifecycle.
The panel uses the required single merged blue header row and avoids clearing the header row during normal updates.
------------------------
Visual Improvements
------------------------
• Improved chart readability by adjusting shelf zones, reaction labels, right-side tags, and fresh/reused shelf opacity.
• Reduced visual clutter by limiting displayed shelves and keeping reaction tags bounded.
• Refined visual hierarchy so active shelf state, strongest shelf, and fresh/reused context stand out more clearly.
• Adjusted zone design so shelf labels are centered inside the horizontal structure area.
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow.
• Added configurable label density, label font size, panel font size, panel position, and panel theme controls.
• Kept the summary panel enabled by default for immediate context.
• Enhanced overall user experience without changing the core volume shelf reaction logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical purpose of the script.
The goal is to improve clarity and usability, not to introduce predictive behavior.
Users should interpret outputs the same way as before, but with improved visual structure.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, available volume quality, and timeframe differences may affect how shelves and reactions appear.
Outputs should always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes.
Users remain responsible for their own decisions.
Phát hành các Ghi chú
🔧 UPDATE NOTES - V1.6This update focuses on visual cleanup, readability, and publication presentation.
The core purpose of the script remains unchanged.
This release improves how the existing volume shelf reaction logic is presented, organized, and interpreted on the chart.
This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
• Reduced default shelf density.
The default visible shelf count was adjusted from four to three to create a cleaner first-view chart.
• Softened shelf zone presentation.
Shelf zones now use lighter default transparency and shorter projection so they support price action instead of dominating it.
• Disabled centered zone text by default.
Zone text remains available in settings, but the default publication view is now cleaner and less text-heavy.
• Reduced reaction label noise.
Reaction label density now defaults to Minimal and the cooldown was increased to reduce repeated historical tags.
• Cleaned right-side shelf tags.
Inactive shelves now show only price instead of an idle-state prefix.
------------------------
Visual Improvements
------------------------
• Improved chart readability by reducing shelf count, zone opacity, projection length, and label density.
• Reduced visual clutter to enhance first-glance interpretation.
• Refined visual hierarchy so active reactions stand out only when they are meaningful.
• Adjusted positioning and text behavior to avoid unnecessary overlap with candles.
------------------------
Interface & Usability
------------------------
• Kept all visual controls available for users who want a more detailed view.
• Preserved panel layout and the required merged blue header row.
• Improved default settings for a cleaner publication screenshot.
• Enhanced overall user experience without changing core logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The goal is to improve clarity and usability, not to introduce new predictive behavior.
Users should interpret outputs the same way as before, but with improved visual structure.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, available volume quality, and timeframe differences may affect how shelves and reactions appear.
Outputs should always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes.
Users remain responsible for their own decisions.
Phát hành các Ghi chú
🔧 UPDATE NOTES - 1.7This update adds a 0-100 shelf score, a live respect-rate proof, and a clear
next-action stance to the Volume Shelf Reaction Map. The shelf detection, memory
engine and reaction state machine remain unchanged. This script continues to
function as an analytical mapping tool. It does not predict price direction or
provide guaranteed outcomes.
------------------------
What Changed
------------------------
- Shelf Score (0-100)
The panel now scores the strongest shelf from its touches, participation
strength, freshness and current reaction, for a quick read of how significant
the level is.
- Shelf Respect Rate (Proof Layer)
The panel now tracks how often eligible shelves are respected (held, reclaimed,
or rejected) versus lost. Outcomes are counted once per regime on confirmed bars
only, so the statistic stays honest and does not repaint.
- Next-Action Stance Row
A new Action row turns the current shelf state and distance into a clear stance -
track hold, fade from shelf, wait for re-acceptance, watch a test, or wait for
the next shelf test.
- Contrast-Safe Reaction Text
Edge tags, reaction labels and the optional centered zone text now use a
luminance helper, so amber, teal, pink and indigo elements stay readable.
- Safer Volatility Handling
The ATR baseline is now guarded against missing values for more consistent
spacing and buffers on thin or early data.
------------------------
Visual Improvements
------------------------
- Clearer reaction tags and shelf edge tags across all states
- Kept the shelf zones, midlines and fade-reused behavior intact
- Preserved the clean default of three visible shelves
- No added chart clutter
------------------------
Interface & Usability
------------------------
- Reworked the panel into State, Visible Shelves, Strongest Shelf, Shelf Score,
Fresh / Reused, Shelf Respect Rate and Action
- Kept all existing settings and defaults backward compatible
- Enhanced overall experience without changing the core engine
------------------------
Behavior Notes
------------------------
This update does not change how shelves are detected or how reactions are
classified. The Shelf Respect Rate is a descriptive, backward-looking statistic,
not a forward prediction. Outputs should be interpreted the same way as before.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool. Volatility, liquidity and
timeframe differences can affect how shelves and reactions appear. Always
interpret outputs within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only. It does not provide
financial advice or guaranteed trading outcomes. Users remain responsible for
their own decisions.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.