Anchored VWAP Regime [ZurvanEG]

3 380
◇ Overview
Anchored VWAP Regime shows not only where fair value sits, but whether the market has actually accepted a direction away from it.
Standard VWAP answers one question: where is the volume-weighted average price? It does not say whether price is trending away from it, rotating around it, or still forming. Most VWAP-based decisions fail here, especially early in the session and on range days with repeated whipsaws.

This script keeps VWAP as the central reference and adds:
⬦ Deviation bands that stay meaningful from the first bars of the anchor
⬦ A directional gate based on acceptance, not single crosses
⬦ A regime classification combining acceptance, trend spread and rotation
⬦ A bounded directional score that reflects structure, not raw distance
⬦ Saturation zones with reversal markers, a formation box and a secondary higher-period VWAP

◇ How It Works
1. Anchoring and Weighting
VWAP resets at a fixed time of day, at each exchange session, or on a higher period. Without volume, it falls back to time weighting (TWAP). Either weighting can also be forced.
2. Effective Deviation (σeff)
All bands and distances use σeff: the anchor’s volume-weighted standard deviation, floored by a fraction of ATR. The floor keeps early bands realistic. Later, the anchor’s own deviation takes over.
3. Maturity
Each anchor has a formation phase in minutes. During it, gate and regime are not evaluated, and the score ramps in gradually.
4. Gate and Dead Zone
A close counts as above or below VWAP only outside a ±k·σeff dead zone. The gate flips only after a set number of consecutive closes beyond it.
5. Trend Spread
Fast and slow exponential VWAPs run continuously across anchors. Their ATR-normalised spread measures directional pressure that does not restart every session. Separate entry and exit thresholds prevent flicker. Resuming the last confirmed trend needs only the lower threshold, which shortens needless transitions after shallow pullbacks.
6. Rotation Count
VWAP crosses inside a window clipped to the current anchor are counted. New trends require low rotation. At the balance threshold, the market is classified as Balance.
7. Confirmation
A new regime must persist for a set number of closed bars.

◈ Regimes
⬦ Trend Up / Trend Down: mature anchor, gate accepted on that side, matching spread, low rotation.
⬦ Balance: rotation at or above the threshold. VWAP acts as a pivot, not a direction.
⬦ Transition: none of the above. Colour follows the score, so the developing lean stays visible.
snapshot
◈ Visual Features
⬦ VWAP Line: regime-coloured, heavier during confirmed trends, with an anchor-period label.
⬦ VWAP ↔ Close Fill: coloured by regime or score, showing which side controls the anchor.
snapshot
⬦ Deviation Bands: two levels with independent multipliers, a value-area fill and a fill between the bands. Everything breaks cleanly at each anchor shift.
snapshot
⬦ Secondary VWAP: an independent higher-period VWAP (for example, weekly) shown as a label, with an optional line.
snapshot
⬦ Saturation: red upper and green lower levels with zone fills, an optional candle highlight with hold bars, and reversal markers on the first close back inside. Reversals against a confirmed trend can be filtered out.
snapshot
⬦ Candle Colouring: plotcandle with regime or score colours.
⬦ Regime Background.
snapshot
⬦ Formation Box: the anchor’s opening range until the first mature close outside VWAP ± a set distance. Only the active midline extends right. An optional label shows price delta, estimated volume delta, volume, range in ATR and duration.
snapshot

◈ Practical Use
⬦ Trend: VWAP and Band 1 act as dynamic support or resistance. Pullbacks that hold on the accepted side, with a score that stays strong, indicate intact structure.
⬦ Balance: VWAP is a pivot. Band extremes, saturation and reversal markers matter more than the line itself.
⬦ Transition: indecision or regime change. Observe rather than act aggressively.
⬦ Formation: a box break in the direction of a later trend gives that trend context. A failed break back into the box is an early warning of balance.

◈ Alerts
All alerts fire on bar close and can be toggled independently:
⬦ Regime shift to Trend Up / Trend Down
⬦ Formation Box break
⬦ Saturation reversal

Individual alert conditions are provided. A single “Any alert() function call” alert covers all enabled categories.

◈ Notes
⬦ Nothing is judged before the anchor matures. This is intentional.
⬦ Regime confirmation is delayed by design.
⬦ On spot and CFD instruments, volume is usually tick volume. The formation volume delta is an estimate.
⬦ Saturation marks stretch, not reversal. A reversal marker shows that the stretch has paused, not that a turn is confirmed.
⬦ The score describes regime quality. It is not an entry signal on its own.
⬦ Values on the realtime bar update until the bar closes.

◈ Conclusion
Anchored VWAP Regime turns anchored VWAP into a regime framework on the price chart. By refusing to judge an immature anchor and by rewarding structure over distance, it separates genuine acceptance from whipsaw around VWAP. It does not replace price structure or risk management. It shows how the market is treating fair value, so VWAP can be used as a trend filter, a pullback reference or a rotation pivot, depending on the regime in force.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.