The volume-weighted average price accumulated from a specific starting bar you choose — an event, a swing point, or a session — rather than an automatic daily reset.
Anchored VWAP (AVWAP) is the volume-weighted average price calculated cumulatively from a specific bar that you choose — the 'anchor' — instead of resetting automatically at each session open the way standard VWAP does. Popularized by Brian Shannon, it answers a precise, descriptive question: from this exact starting point (an earnings release, a swing high or low, a breakout bar, a year open), what average price has been paid, weighting every bar's typical price by its volume? Because higher-volume bars pull the average harder, AVWAP is often described as tracking the average position cost of participants since the anchor event. The calculation itself is exact and deterministic; the honesty caveat is the anchor. The anchor is a human choice, usually made after the event has already proven significant — which is hindsight. An AVWAP anchored to 'the major low' looks meaningful precisely because you already know it was the major low. The line describes past transactions from a chosen origin; it does not predict where price will go, no anchor choice changes that, and this is educational content only — trading involves risk of loss.
From the anchor bar forward, keep two running sums: cumulative (typical price × volume) and cumulative volume. AVWAP on any bar is the first sum divided by the second: AVWAP = Σ(Pᵢ·Vᵢ) / Σ(Vᵢ), summed from the anchor bar to the current bar, where Pᵢ is usually hlc3 (high+low+close)/3. Nothing resets after the anchor — every bar since the anchor stays in the sums forever, which is what distinguishes it from rolling averages like VWMA (fixed window) and from session VWAP (daily reset). Two properties follow directly from the math. First, the line stiffens over time: as cumulative volume grows, each new bar is a smaller fraction of the total, so an AVWAP anchored months ago barely moves day to day while a fresh anchor swings with every bar. Second, implementation matters: the naive Pine approach of calling ta.vwap, or resetting sums on a condition that can fire more than once, silently produces a line that resets when you didn't intend it to. The correct implementation initializes both sums exactly once — on the first bar at or after the anchor time — and accumulates on every bar after, as in the example below.
There is no length parameter — the only settings are the anchor and the price source. Common anchors: session, week, month, quarter, or year opens; earnings or news bars; prominent swing highs and lows; IPO or listing bars. The source is typically hlc3, though some implementations use close. On TradingView, an interactive time input (input.time with confirm = true) lets you click the anchor bar directly on the chart. Note that intraday volume differs across data feeds, so the same anchor can produce slightly different AVWAP values on different platforms.
//@version=6
indicator("Anchored VWAP Example", overlay = true)
anchorTime = input.time(timestamp("2026-01-02 00:00 +0000"), "Anchor", confirm = true)
src = input.source(hlc3, "Source")
var float cumPV = na
var float cumVol = na
bool atAnchor = time >= anchorTime and (na(time[1]) or time[1] < anchorTime)
if atAnchor
// Initialize the sums exactly once, on the first bar at/after the anchor.
cumPV := src * volume
cumVol := volume
else if time >= anchorTime
cumPV := cumPV + src * volume
cumVol := cumVol + volume
float avwap = not na(cumVol) and cumVol > 0 ? cumPV / cumVol : na
plot(avwap, "Anchored VWAP", color = color.blue, linewidth = 2)Pro tip: Stress-test your anchors for hindsight: before studying how price 'respected' an AVWAP from a major low, also anchor a few lines to unremarkable bars from the same period and compare. If arbitrary anchors produce similar-looking touches, the significance you saw was partly pattern-matching on a line that had to be near price anyway. Used honestly — anchored to events you would have identified in real time, with the feed-dependence of volume in mind — AVWAP is a precise descriptive reference. It is educational context, not a signal: no anchor predicts price, and trading involves risk of loss.
Educational only — not financial advice, not a recommendation to trade. No indicator is predictive; trading involves substantial risk of loss.