Editors' picks
OPEN-SOURCE SCRIPT
Updated

Dynamic Swing Anchored VWAP (Zeiierman)

22 847
Overview
Dynamic Swing Anchored VWAP (Zeiierman) is a price–volume tool that anchors VWAP at fresh swing highs/lows and then adapts its responsiveness as conditions change. Instead of one static VWAP that drifts away over time, this indicator re-anchors at meaningful structure points (swings). It computes a decayed, volume-weighted average that can speed up in volatile markets and slow down during quiet periods.
snapshot
Blending swing structure with an adaptive VWAP engine creates a fair-value path that stays aligned with current price behavior, making retests, pullbacks, and mean reversion opportunities easier to spot and trade.

How It Works
Swing Anchor Engine
  • The script scans for swing highs/lows using your Swing Period.
  • When market direction flips (new pivot confirmed), the indicator anchors a new VWAP at that pivot and starts tracking from there.

Adaptive VWAP Core
  • From each anchor, VWAP is computed using a decay model (recent price×volume matters more; older data matters less).
  • Adaptive Price Tracking lets you set the base responsiveness in “bars.” Lower = more reactive, higher = smoother.
  • Volatility Adjustment (ATR vs Avg ATR) can automatically speed up the VWAP during spikes and slow it during compression, so the line stays relevant to live conditions.

Why This Adaptive Approach Beats a Simple VWAP

Standard VWAP is cumulative from the anchor point. As time passes and volume accumulates, it often drifts far from current price, especially in prolonged trends or multi-session moves. That drift makes retests rare and unreliable.

Dynamic Swing Anchored VWAP solves this in two ways:

Event-Driven Anchoring (Swings):
By restarting at fresh swing highs/lows, the VWAP reference reflects today’s structure. You get frequent, meaningful retests because the anchor stays near the action.

Adaptive Responsiveness (Volatility-Aware):
Markets don’t move at one speed. When volatility expands, a fixed VWAP lags; when volatility contracts, it can overreact to noise. Here, the “tracking speed” can auto-adjust using ATR vs its average.
  • High Volatility → faster tracking: VWAP hugs price more tightly, preserving retest relevance.
  • Low Volatility → smoother tracking: VWAP filters chop and stays stable.

Result: A VWAP that follows price more accurately, creating plenty of credible retest opportunities and more trustworthy mean-reversion/continuation reads than a simple, ever-growing VWAP.
snapshot

How to Use

⚪ Swing-Aware Fair Value
Use the VWAP as a dynamic fair-value guide that restarts at key structural pivots. Pullbacks to the VWAP after impulsive moves often provide retest entries.
snapshot

Trend Trading
In trends, the adaptive VWAP will ride closer to price, offering continuation pullbacks.
snapshot

Settings
  • Swing Period: Number of bars to confirm swing highs/lows. Larger = bigger, cleaner pivots (slower); smaller = more frequent pivots (noisier).
  • Adaptive Price Tracking: Sets the base reaction speed (in bars). Lower = faster, tighter to price; higher = smoother, slower.
  • Adapt APT by ATR ratio: When ON, the tracking speed auto-adjusts with market volatility (ATR vs its own average). High vol → faster; low vol → calmer.
  • Volatility Bias: Controls how strongly volatility affects the speed. >1 = stronger effect; <1 = lighter touch.


-----------------
Disclaimer

The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.

All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Release Notes
minor color fix

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.