Smart Swing VWAP (Zeiierman)█ Overview
Smart Swing VWAP (Zeiierman) is an adaptive price-volume tool that automatically selects meaningful swing highs and lows as VWAP anchors. Instead of relying on one fixed swing period, the indicator analyzes five configurable swing scales and ranks their current structure using price movement, volatility, volume participation, swing size, and agreement between scales.
Once the strongest qualifying swing is selected, the indicator builds a decayed, volume-weighted average from that anchor. Recent price and volume receive more influence, while older data gradually loses importance. This allows the VWAP to remain responsive during active markets without becoming excessively noisy during quieter conditions.
Blending multi-scale swing structure with an adaptive VWAP engine creates a dynamic fair-value path that stays connected to current market behavior. This makes trend pullbacks, structural breaks, retests, continuation setups, and mean-reversion areas easier to identify.
Smart Swing VWAP builds upon the foundation of Dynamic Swing Anchored VWAP (Zeiierman) , which introduced swing-based re-anchoring combined with an adaptive, decayed volume-weighted average. This version expands that concept with five-scale swing analysis, matrix-based anchor ranking, anchor quality filters, structural break handling, selectable line behavior, and automated retest detection.
█ How It Works
⚪ Smart Swing Selection
The indicator tracks five swing scales simultaneously. Each candidate is evaluated using cross-scale agreement, swing range, directional progress, volatility expansion, and volume participation.
float sc = 100.0 * (0.25 * cs + 0.20 * rg + 0.55 * en)
Only swings that pass the Minimum Anchor Score, Minimum Move Strength, and Bars Between New Anchors requirements can become the active VWAP anchor. This helps prevent constant re-anchoring during noisy or overlapping market structure.
⚪ Adaptive VWAP
Once an anchor is selected, the script calculates a decayed volume-weighted average. Recent price and volume matter more, while older observations gradually lose influence.
pv := (1.0 - alx) * pv + alx * hlc3 * vi
vv := (1.0 - alx) * vv + alx * vi
vw := vv > 0 ? pv / vv : na
Price Tracking Speed controls the base responsiveness. The optional volatility adjustment compares current ATR with its average, allowing the VWAP to react faster during volatility expansion and move more smoothly during quieter conditions.
⚪ Structure And Line Behavior
After an anchor is accepted, the indicator tracks the strongest opposite swing. A confirmed close through the active structural level changes the bullish or bearish state.
Users can choose between two behaviors:
Recolor Entire Active Line: Keeps one continuous VWAP and recolors the complete active path when structure changes.
Preserve Old Color And Start New Segment: Keeps the previous color visible and begins a new segment from the confirmed structure-break bar.
⚪ Historical Anchor Reconstruction
When a swing wins the ranking process, the indicator rebuilds the active VWAP from the original swing bar. This displays the complete price-volume path that developed from the selected structure point.
The anchor is only accepted after the ranking conditions are confirmed. The reconstructed historical line does not mean the winning swing was known in real time at the original pivot bar.
█ Why This Adaptive Approach Beats a Simple VWAP
Standard anchored VWAP uses one manually selected starting point. Its usefulness depends heavily on whether that anchor remains important as market structure changes.
A cumulative VWAP can also become increasingly resistant to new price information because every historical price-volume observation remains permanently included. During long trends or multi-session moves, this can cause the VWAP to drift far away from the current price.
Smart Swing VWAP addresses these problems in three ways:
⚪ Smart Multi-Scale Anchoring
Instead of using one fixed swing period, the indicator compares several structural horizons.
Shorter scales react to fast local movement, while longer scales identify broader market pivots. The ranking system selects the swing with the strongest combination of agreement, range, movement quality, volatility, and volume participation.
⚪ Decayed Price-Volume Weighting
Older information gradually loses influence instead of remaining permanently dominant.
This allows the VWAP to stay closer to the market’s current perception of fair value and can create more relevant pullbacks and retests than a traditional cumulative VWAP.
⚪ Volatility-Aware Responsiveness
Markets do not move at one constant speed.
High Volatility → faster tracking: The VWAP responds more quickly and remains closer to active price movement.
Low Volatility → smoother tracking: The VWAP filters smaller fluctuations and remains more stable.
Result: A structure-aware VWAP that can adapt its anchor, responsiveness, and directional presentation as market conditions evolve.
█ How to Use
⚪ Trend Trading
During bullish structure, the green VWAP can act as a dynamic support reference. Look for price to remain above the line, pull back toward it, and then show renewed buying pressure.
During bearish structure, the red VWAP can act as a dynamic resistance reference. Look for price to remain below the line, retrace toward it, and then show renewed selling pressure.
█ Settings
Pivot Scales: Enables or disables each swing scale used by the ranking engine. More active scales provide broader structural comparison.
Length: Number of bars used to detect swing highs and lows for each scale. Smaller = faster and noisier; larger = slower and cleaner.
After Structure Break: Chooses whether the entire active VWAP changes color or the previous color is preserved and a new segment begins.
Price Tracking Speed: Sets the base VWAP reaction speed. Lower = faster and tighter to price; higher = smoother and slower.
Adjust Speed With Volatility: When ON, tracking speed automatically adjusts using current ATR relative to its average. High volatility = faster; low volatility = smoother.
Volatility Adjustment Strength: Controls how strongly volatility changes the tracking speed. Higher values = stronger adjustment.
Minimum Anchor Score: Minimum total ranking score required before a swing can become the active VWAP anchor. Higher = fewer, more selective anchors.
Minimum Move Strength: Requires directional progress, volatility expansion, and volume participation before accepting a swing. Higher = stronger moves only.
Bars Between New Anchors: Minimum number of confirmed bars before another swing can replace the active anchor. Higher = fewer anchor changes.
Retest Touch Zone (ATR): Maximum distance from the VWAP that counts as a retest touch. Higher = wider touch zone.
Retest Setup Distance (ATR): Minimum distance price must first move away from the VWAP before a later return can trigger a retest.
-----------------
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.
Indicator



