OPEN-SOURCE SCRIPT

Anchored VWAP Bands Strategy [Gabremoku]

790
Anchored VWAP Bands Strategy [Gabremoku] is a context-driven fair value indicator that combines Anchored VWAP, deviation bands, directional bias, and retest/stretch-based entry logic into a single overlay.

The script uses Anchored VWAP as its core reference line, allowing the user to define a custom starting point by time or bars back. Unlike standard VWAP, which resets on a regular session basis, Anchored VWAP starts from a specific event or pivot selected by the trader, making it especially useful for tracking price behavior relative to an important market reference point.

On top of that, the indicator adds sigma-style bands, dynamic fair value coloring, directional state reading, and optional entry signals built around AVWAP retests and band reversals.

What it shows
โš“ Anchored VWAP โ€” the volume-weighted average price from a user-defined anchor point. Anchored VWAP is commonly used to estimate fair value from a specific event and to monitor whether price is trading above or below that reference.

๐Ÿ“ Deviation Bands โ€” up to three upper and lower bands built from either:

anchored standard deviation

or rolling standard deviation

These bands help show how far price has deviated from anchored fair value and can be used to identify balance, expansion, or stretch conditions.

๐ŸŒˆ Dynamic Gradient Bias โ€” AVWAP and its fills change color based on price location and directional pressure relative to the center.

๐Ÿงญ Directional State โ€” the script classifies price into states such as:

Fair Value

Bullish Balance

Bullish Expansion

Bullish Stretch

Bearish Balance

Bearish Expansion

Bearish Stretch

๐ŸŽฏ Entry and Target Logic โ€” optional long/short signals and dynamic target markers based on AVWAP retests or outer-band reversals.

๐Ÿชง Dashboard โ€” displays state, bias, AVWAP slope, distance from fair value, anchor age, and Long-S status.

Core logic
The main idea behind this script is simple:

AVWAP defines fair value from a chosen event

bands define statistical distance from that fair value

slope helps determine directional bias

signals look for retests or stretched reversals

Anchored VWAP is often used to analyze where the marketโ€™s volume-weighted average price sits from a meaningful point in time, and many traders use it as a dynamic support/resistance or bias line. Price above AVWAP is often interpreted as relatively stronger positioning, while price below it can imply weaker positioning.

By adding deviation bands, this script gives a clearer structure for distinguishing between:

normal pullbacks,

balanced price action,

and statistically extended moves.

Signal logic
The script supports Both, Long, or Short directional modes, with three signal styles:

Retest AVWAP

Band Reversal

Hybrid

Long ideas
Long signals can trigger when:

price retests AVWAP and closes back above it

or price reacts from the lower band and reclaims it

Short ideas
Short signals can trigger when:

price retests AVWAP from below and closes back under it

or price reacts from the upper band and falls back below it

There is also a Long-S logic tied to reactions around Lower Band 1, with AVWAP used as a potential target when enabled.

This makes the tool useful both for:

trend continuation via AVWAP retests

and mean-reversion or snapback setups from band extremes

Why it matters
One of the biggest strengths of Anchored VWAP is that it adds context.

Instead of asking โ€œis price high or low?โ€ in a generic way, AVWAP asks:
โ€œIs price rich or discounted relative to a meaningful market event and its volume?โ€

That is why Anchored VWAP is commonly anchored to:

breakout bars

swing highs or lows

earnings events

gaps

major session turning points

In that framework:

AVWAP becomes fair value

slope becomes directional bias

bands become expansion/stretch zones

retests become opportunity areas

Features
โœ… Anchored VWAP with time-based or bars-back anchoring

โœ… Optional anchor reset logic

โœ… Anchored or rolling standard deviation bands

โœ… Up to three sigma-style upper/lower bands

โœ… Dynamic center-line and fill coloring

โœ… Fair value / expansion / stretch state classification

โœ… Long / Short / Both strategy modes

โœ… Retest AVWAP, Band Reversal, or Hybrid signal modes

โœ… Optional slope filter

โœ… Optional close-confirmation filter

โœ… Dynamic target plotting

โœ… Long-S lower-band reaction logic

โœ… Bias background shading

โœ… AVWAP label and dashboard

โœ… Built-in alert conditions

How to use
A practical workflow is:

Choose a meaningful anchor point.

Use AVWAP as the fair value reference.

Read slope for directional bias.

Use the bands to identify balance vs expansion vs stretch.

Trigger entries on:

AVWAP retests in trend

band reversals after extension

In general:

above a rising AVWAP often supports bullish continuation logic

below a falling AVWAP often supports bearish continuation logic

far from AVWAP near outer bands can signal stretch or reaction zones rather than efficient price

Notes
This indicator is designed as a fair value and execution-context tool, not as a full standalone strategy with complete trade management. Anchored VWAP is highly dependent on anchor quality, so the usefulness of the line improves when the anchor is tied to a genuinely meaningful price event.

Author: Gabremoku
Pine Script v6

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.