OPEN-SOURCE SCRIPT
已更新

AG Pro Anchored VWAP Event Map [AGPro Series]

8 705
AG Pro Anchored VWAP Event Map [AGPro Series]

Overview / What it does

AG Pro Anchored VWAP Event Map is an overlay built to organize price action around Anchored VWAP after a meaningful starting point has been defined. Instead of treating VWAP as a single static reference, this script focuses on the relationship between price and a chosen anchor, then maps how the market behaves after that anchor is established. The goal is not to forecast price, but to make post-anchor structure easier to read in a consistent visual framework.

The script supports three anchor paths: Open, Swing, and Event. Open mode can reset the anchor from a daily, weekly, or monthly opening context. Swing mode rebuilds the anchor from a confirmed pivot high or pivot low. Event mode is designed for expansion-type situations and can anchor from a range expansion, a volume spike, or a breakout impulse. This creates a flexible workflow for traders who want to study how price responds to AVWAP under different structural conditions without switching tools.

Once the anchor is set, the script plots the Anchored VWAP, builds a distance band around it, tracks reclaim and reject behavior, and summarizes the current post-anchor bias in a compact panel. The result is a clean event map that can be used to study acceptance, rejection, recovery, or continuation around an anchored reference level. It is meant to simplify interpretation, not replace market context.

A key design goal of this script is clarity. The visual package is intentionally structured so the anchor, AVWAP path, distance zone, signal labels, and bias panel can be read together without turning the chart into a dense signal board. In practice, that means the indicator is most useful when it is treated as a contextual decision-support tool rather than a standalone trigger engine.

Unique Edge

The main distinction of this script is that it is not built as a generic VWAP overlay. Its emphasis is on post-anchor behavior. That means the visual logic starts from the selected anchor event and then evaluates how price interacts with the anchored VWAP afterward. In other words, the anchor is not only a starting point for the line itself; it is the center of the script's interpretation model.

Another differentiator is the combination of multiple anchor sources within one workflow. Traders can use opening-session logic, confirmed swing logic, or event-driven logic depending on the type of market behavior they are studying. This makes the indicator suitable for different styles of chart review while keeping the interface straightforward.

The distance band adds a second layer of structure. Rather than reading only the AVWAP line, users can also see whether price is operating close to the reference, stretched around it, or reacting from the upper or lower band zone. This helps frame whether a move appears to be re-accepting the anchored average, rejecting away from it, or trading in a more extended state.

The script also tries to keep the signal layer readable through selective label logic. Reclaim and reject markers are not intended to flood the chart. They are there to mark notable interactions with the anchored framework, while the panel provides a compact summary of the active anchor, current bias, distance, and latest signal state.

Methodology

The script begins by defining an anchor source. In Open mode, the anchor can be tied to a daily, weekly, or monthly opening transition. In Swing mode, the script waits for a confirmed pivot high or pivot low based on the selected swing length. In Event mode, the anchor is created only when a qualifying market event appears according to the selected event model.

For event-based anchoring, the script can use one of three internal conditions. Range Expansion looks for directional range behavior relative to ATR and recent structure. Volume Spike looks for directional participation with higher-than-average volume and a meaningful candle body fraction. Breakout Impulse looks for directional movement through recent extremes with supportive range and volume characteristics. These are practical anchor candidates for traders who want the AVWAP to begin from a meaningful change in behavior rather than from a calendar reset.

After the anchor is created, the script calculates Anchored VWAP using cumulative price-volume data relative to that anchor point. From there, it builds a distance band around the AVWAP. The band can be defined by ATR or percentage mode, depending on whether the user prefers a volatility-based or proportional framework.

Post-anchor bias is then derived from a simple internal score. The script evaluates whether price is above or below AVWAP, whether the AVWAP slope is improving or weakening, and whether price is trading beyond the distance band. This produces a practical Bullish, Bearish, or Neutral state. The intention is not to compress market structure into a perfect score, but to provide a compact directional read that can be used alongside the chart.

Reclaim and reject logic is based on how price interacts with the AVWAP and the surrounding band after the anchor is active. A reclaim highlights price moving back through the anchored reference with confirmation, while a reject highlights failure or pushback behavior around the band area. These events are intended as structural observations rather than guaranteed trade setups.

Signals & Alerts

The script includes reclaim and reject signal logic for both directions. These labels are designed to call attention to notable interactions with the anchored framework after the selected anchor becomes active. In practical use, reclaim behavior can be interpreted as a sign that price is attempting to re-establish acceptance relative to AVWAP, while reject behavior can suggest rejection away from the mapped zone.

Because market structure can become noisy, the script also includes signal spacing and density controls to reduce repetitive label clutter. This is especially relevant when anchored conditions remain active for long periods and price repeatedly tests the same area. The goal is to preserve readability while still marking relevant interactions.

Alert conditions are included for bullish reclaim, bearish reclaim, bullish reject, bearish reject, and a broader any-signal state. These alerts are deterministic within the script's ruleset, but they should still be used as workflow tools rather than interpreted as self-sufficient trading instructions.

Key Inputs

Anchor Source:
Choose whether the indicator should anchor from Open, Swing, or Event logic.

Open Anchor Type:
In Open mode, select daily, weekly, or monthly opening context.

Swing Length:
Controls how confirmed pivot highs and lows are detected in Swing mode.

Event Type:
In Event mode, choose between Range Expansion, Volume Spike, or Breakout Impulse as the anchor trigger model.

Event Lookback / Multipliers / Cooldown:
These inputs control how strict the event selection becomes and how frequently new event anchors can appear.

Band Mode:
Switch between ATR-based and percentage-based distance bands.

ATR Band Multiplier / Percent Band:
Define the width of the distance zone around Anchored VWAP.

Signal Density:
Helps regulate how aggressively reclaim and reject labels are displayed.

Panel and Label Size:
Allows the visual layout to remain readable across different chart styles and screen sizes.

Show Anchor Label / Show Anchor Level / Show Bias Ribbon:
These toggles control the visibility of anchor-focused visual elements and optional bias coloring.

Limitations & Transparency

This script is an interpretation aid. It does not identify the single correct anchor for all market environments. Different anchor choices can lead to different AVWAP paths, different reclaim or reject readings, and different conclusions. That is normal, and it is one of the reasons the script provides multiple anchor modes.

Event-based anchors depend on internal threshold logic such as ATR expansion, volume conditions, and breakout behavior. On some symbols or timeframes, those filters may trigger more frequently or less frequently than expected. Users may need to adjust event sensitivity and band settings to fit the market they are analyzing.

Reclaim and reject states are rule-based. They are not a guarantee of continuation, reversal, or follow-through. In sideways conditions, repeated AVWAP interactions can occur without producing a sustained directional move. The script can help organize those interactions visually, but it cannot remove market uncertainty.

The post-anchor bias is intentionally simplified. It is designed for readability, not for complete market classification. It should be read together with broader price structure, higher-timeframe context, liquidity conditions, and user-defined execution rules.

Risk Disclosure

This indicator is for chart analysis and workflow support. It does not provide financial advice, investment advice, or guaranteed outcomes. Markets involve risk, and any trading or investing decision remains the sole responsibility of the user.

No indicator can remove uncertainty from live markets. Anchored VWAP, reclaim behavior, reject behavior, and bias states are analytical references only. They should be validated with independent judgment, risk management, and broader market context before being used in any decision-making process.

Use this script as a structured visualization tool, not as a promise of performance or a substitute for disciplined trade planning.
版本注释
UPDATE NOTES - V1.2

This update focuses on presentation quality, panel consistency, and chart readability.

The core purpose of the script remains the same: to organize anchored VWAP behavior around event-based, swing-based, or open-based anchors, then surface reclaim and reject behavior in a structured way. This release does not reframe the script as a prediction tool, and it does not introduce a new trading model. Instead, it improves how information is displayed so the script becomes easier to read at a glance and cleaner in published chart views.

What changed

• Refined the main panel to match the current AG Pro visual standard
• Kept the first row as a single merged title bar with the standard AG Pro blue header
• Set the panel default font size to Small for a cleaner and more compact chart footprint
• Simplified and tightened panel row wording for faster reading
• Preserved strong contrast between labels, values, and status fields inside the panel
• Increased the distance between signal labels and candles so reclaim / reject markers breathe better on the chart
• Added a dedicated AVWAP label at the right edge of the line so the active anchored VWAP can be identified immediately
• Improved right-edge chart readability without expanding the visual footprint of the script unnecessarily

Why this update was made

The previous version already had a functional panel and clear core logic, but the presentation layer could be improved to better fit the newer AG Pro publication standard. In practical use, compact visual hierarchy matters. A script that is logically strong but visually crowded often becomes harder to interpret, especially when the chart already contains strong price movement, multiple swing transitions, or repeated reclaim / reject sequences.

This update was designed to improve first-glance recognition. The panel now reads more like a compact institutional status block rather than a generic settings table, while the chart labels sit with slightly more spacing from price so they remain readable without feeling glued to the candles. The added AVWAP endpoint tag also helps define the active line clearly on the right side of the chart, especially during fast continuation phases or when multiple recent reactions have formed around the anchored VWAP.

What did not change

This release is intentionally light on core logic changes.

• No change to the anchor source framework
• No change to Open, Swing, or Event anchor modes
• No change to AVWAP calculation logic
• No change to the distance band engine
• No change to reclaim / reject detection logic
• No change to alert condition structure
• No change to the underlying directional bias framework

In other words, this version is primarily a usability and display refinement rather than a methodology rewrite.

Panel update details

The panel has been adjusted to better match the current AG Pro panel language used across newer releases. The title row remains a single merged header with the standard blue background, while the body keeps a dark, high-contrast structure for consistent visibility across different chart themes. The result is a panel that feels more compact and deliberate without becoming too small to read.

The new default Small panel text size also helps reduce panel dominance on the chart. This matters because the panel should support decision context, not compete with the main price structure. The goal is to keep the chart itself as the main stage while allowing the panel to function as a clean secondary information block.

Label spacing improvement

Signal labels were repositioned slightly farther from candle bodies and wicks. This is a subtle change, but it improves chart cleanliness, especially in sections where reclaim and reject sequences appear close together. The adjustment helps preserve readability while keeping labels visually associated with the correct bar.

This kind of spacing change is useful both for live chart use and for publication screenshots, because it reduces the impression of compression around price. The chart can now breathe a bit more while still preserving direct signal context.

AVWAP endpoint label

A dedicated AVWAP tag has been added near the right edge of the plotted anchored VWAP line. This makes the active AVWAP easier to identify immediately, especially when the line is interacting with price repeatedly or when users are reviewing the chart quickly.

The intention is not to add decorative clutter, but to improve line recognition and directional context. The label uses the line color language so it remains visually tied to the plotted AVWAP rather than appearing as an unrelated chart object.

Usability impact

From a practical chart-reading perspective, this version should feel cleaner, more stable, and easier to interpret quickly. The panel consumes less attention, labels have better breathing room, and the AVWAP line is easier to identify at the right edge of the chart. None of these changes alter the analytical engine, but together they improve the user experience meaningfully.

This is particularly helpful for users who rely on anchored VWAP structure as a contextual framework rather than as a standalone signal source. When the visual layer is cleaner, it becomes easier to read post-anchor behavior, distance from value, and reclaim / reject interaction with less friction.

Transparency

This update is a presentation and usability revision. It improves organization, readability, and right-edge clarity, but it does not guarantee outcomes and it should not be interpreted as a promise of stronger market performance. The script remains an analytical chart tool designed to help structure observation around anchored VWAP behavior.

As always, anchored VWAP reactions should be evaluated in context with market structure, volatility conditions, liquidity behavior, and the user's own risk process.
版本注释
v1.3 — Visual Refinement Update

- Panel default font size set to Normal for improved readability.
- Signal density default changed to Strict with wider spacing
(12 bars, 0.75 ATR minimum gap) to produce a cleaner chart.
- Event anchor label placement is now direction-aware to avoid
overlap with the live price tag.
- AVWAP end-tag offset increased to 5 bars to prevent collision
with the price axis label.
- Code header standardized to the AGPro Series format.

No changes to detection logic, alerts, or calculations. Existing
saved settings are preserved; new defaults apply only on first load.
版本注释
v1.4 — Cleaner visuals, smarter filtering, richer context.

• Event Reaction Zone — after an event anchor fires, a dynamic zone brackets the follow-through range for immediate context.
• Adaptive label offsets — signal labels now scale with bar volatility and never bury inside candles.
• Per-anchor signal cap and anchor-proximity guard — prevents label collisions and keeps the chart premium across any regime.
• Panel upgrades — new Anchor Age and Reactions rows show how mature the current AVWAP leg is at a glance.
• High Conviction read — the bias row highlights when anchor direction and composite bias align.
• New alerts — "New Anchor" and "High Conviction."
• Full professional tooltips on every input.

No breaking changes. Previous behavior is preserved with tighter default filtering.
版本注释
UPDATE NOTES - V4.2

This update focuses on publication screenshot readability and zone-badge placement.

The core purpose of the script remains unchanged.
This release improves how the active event reaction zone badge appears when price is trading inside or near the zone.

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
------------------------

* Repositioned the event-zone badge by default.
Zone badges now use a Smart Edge placement mode so they do not sit directly on top of candles.

* Shortened zone badge text.
The active zone badge now uses compact "BULL ZONE" and "BEAR ZONE" wording for cleaner chart presentation.

* Added a zone badge placement input.
Users can choose Smart Edge for cleaner screenshots or Centered when the zone has enough visual room.

* Added an ATR-based zone badge offset input.
The badge can be spaced farther from the zone when candles, labels, or the current price line feel too close.

* Preserved the anchored VWAP event model.
Anchor logic, AVWAP calculation, distance bands, reclaim/reject labels, panel state, and alerts remain intact.


------------------------
Visual Improvements
------------------------

* Reduced candle overlap around the active event reaction zone.

* Improved the latest-zone screenshot by moving the zone badge away from dense price action.

* Kept the event zone visible while making the text badge easier to read on dark and light charts.

* Preserved premium colored labels instead of naked chart text.


------------------------
Interface & Usability
------------------------

* Added "Zone Badge Placement" with Smart Edge and Centered options.

* Added "Zone Badge Offset ATR" for direct spacing control.

* Kept label font size, panel font size, panel theme, panel location, and panel show/hide controls intact.

* Enhanced default usability without changing core analytical interpretation.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The goal is visual clarity and publication polish, not new predictive behavior.

Users should interpret outputs the same way as before, but with cleaner active-zone badge placement.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and active-zone compression may affect how labels 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.
版本注释
UPDATE NOTES - v4.3

This update focuses on readability and visual clarity.

The core purpose of the script remains unchanged. This release refines how the
existing anchored VWAP engine is presented 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
------------------------

- New Band State row in the panel
The panel now shows a short band-relative read - "Above Upper", "Below Lower",
or "In Band" - so the price's position against the distance band is clear at a
glance, alongside the existing AVWAP distance percentage.

- Stronger distance-band presence
The distance-zone fill was given a touch more presence so the anchored VWAP
band reads clearly as the chart's reference structure, including at a glance.

- Refined bias tint
The optional bias bar tint was nudged slightly so the prevailing context is a
little easier to perceive without overpowering the candles.


------------------------
Visual Improvements
------------------------

- Improved first-glance readability of the anchored VWAP band and bias context.

- Refined visual hierarchy so the AVWAP, its band, and the active anchor remain
the focal points.

- Kept signal labels offset above or below candles instead of buried inside
them.

- Preserved the clean, spaced signal labeling that keeps the chart readable.


------------------------
Interface & Usability
------------------------

- Optimized the panel layout with an added band-state context read.

- Improved information flow so the anchor, bias, band state, and reactions are
easy to scan.

- Adjusted default visual settings (band and bias presence) for a more balanced
appearance.

- 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. Anchor selection, the anchored VWAP and band calculation, reclaim and
reject detection, the bias read, and the reaction counts all behave exactly as
before.

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, and timeframe differences may
affect how the anchor, band, and signals 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.
版本注释
🔧 UPDATE NOTES - v4.4

This update focuses on adding a decision read and unifying label contrast.

The core purpose of the script remains unchanged.
This release adds a next-action read and a stop-aware follow-through proof rate
to the panel, makes every on-chart badge contrast-safe, and hardens the ATR
baseline. It does not change the anchor, band, or signal logic.

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
------------------------

• Action row added
A single next-step read derived from the bias, anchor direction, and band state:
favor long or short continuation on high-conviction alignment, longs or shorts
favored on directional bias, an extended-wait read at the band edges, or a
neutral wait read inside the band.

• Stop-aware Proof row added
On each reclaim or reject signal, the planner measures from the signal bar close
whether price closed to a 1.5 ATR follow-through before closing 1.0 ATR against
it. Both sides are evaluated on confirmed closes so the race stays fair,
unresolved signals time out without being counted, and the row reads
"Building (n)" until at least 6 samples exist, e.g. "52% (20)".

• Unified label contrast
Anchor labels, swing labels, event labels, zone badges, signal labels, and the
AVWAP tag now derive their text color from the fill brightness, so every badge
stays legible on both bright and dark fills.

• Cleaner zone badge placement
Removed a fixed minimum-tick floor from the zone badge offset so the badge sits
purely ATR-relative and no longer drifts away from the zone on low-priced symbols.

• Hardened ATR baseline
The ATR used across the engine now falls back to true range and a minimum tick
on early or illiquid bars.


------------------------
Visual Improvements
------------------------

• Improved label readability by deriving text color from each badge fill

• Kept anchor levels, distance band, and reaction zone visuals unchanged

• Maintained controlled signal spacing and per-anchor caps for a clean chart


------------------------
Interface & Usability
------------------------

• Panel now adds an Action read and a Proof follow-through statistic at the bottom

• Grouped context and next step so the read flows top to bottom

• Enhanced overall user experience without changing the core engine


------------------------
Behavior Notes
------------------------

This update does not change the core anchor, band, bias, or signal logic.

The Action read is a context summary and the Proof row is a historical,
descriptive follow-through statistic measured on confirmed closes. Neither is a
forecast, win rate, or trade instruction, and the proof rate is symbol- and
timeframe-dependent.

Users should interpret outputs the same way as before, now with an added action
and follow-through context.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how signals, the anchor, and the proof rate 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.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。