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

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。