OPEN-SOURCE SCRIPT
Aggiornato

2-Day Volume Weighted Average Price (VWAP)

205
This indicator extends TradingView’s built-in VWAP by calculating a volume-weighted average price over a continuous two-day window (yesterday + today), anchoring VWAP at the start of yesterday’s session and carrying it through to today’s close, but only plotting the segment that falls within the current trading session—yesterday’s data feeds into the calculation to ensure today’s VWAP reflects the prior session’s volume and price action, while the line drawn on your chart always begins at today’s session open.

Standard Deviation Bands: Optional ±1σ, ±2σ, and ±3σ envelopes, exactly as in the default VWAP, but based on the rolling two-day data.
Note di rilascio
OVERVIEW

This indicator extends the standard Volume Weighted Average Price (VWAP) to a two-day rolling window, offering a broader perspective on market value and trends by including the previous day's volume and price data. It plots a VWAP line starting from the current session's open, influenced by yesterday's activity, along with optional bands for additional context.

CONCEPTS

The Volume Weighted Average Price (VWAP) is a trading benchmark that calculates the average price a security has traded at throughout the day, weighted by volume. It works by summing the product of price and volume for each transaction and dividing by the total volume, resetting daily. Traders use it to assess whether a security is bought or sold at a good value relative to the market average, often as a reference for trend direction or entry/exit points.

The 2-Day VWAP builds on this by calculating the VWAP over a continuous two-day period. It accumulates volume and price data from yesterday and today, carrying over the prior session's values. The calculation involves:

  • Tracking cumulative volume and the sum of (price × volume) from the start of yesterday's session.
  • Computing the VWAP as cumulative (price × volume) ÷ cumulative volume.
  • Plotting only the current session’s segment, influenced by the two-day data.
  • Optional bands (standard deviation or percentage-based) enhance analysis of volatility and support/resistance.


This makes the 2-Day VWAP useful for capturing extended trends and overnight effects, offering a more comprehensive view than the standard VWAP. Specifically, by incorporating two days of data, it provides extended fair value insight, helping traders determine if the current price is above or below the broader average, which can signal trend continuation or reversal. Additionally, it can indicate institutional activity, as large orders often take multiple days to execute, and tracking two days of price and volume can reveal patterns from these orders.

HOW TO USE

Add the indicator to your chart to display the 2-Day VWAP line and optional bands. Customize via:

  • Source: Select price data (default: HLC3).
  • Offset: Adjust plot displacement.
  • Hide on Daily or Above: Hide on daily+ timeframes.
  • Bands Calculation Mode: Choose 'Standard Deviation' or 'Percentage'.
  • Bands: Enable/disable and set multipliers.


Use it to identify broader trends and value areas, complementing intraday strategies with extended context.

LIMITATIONS

The 2-Day VWAP may be less sensitive to intraday price shifts compared to the standard VWAP. Its effectiveness depends on the security and market conditions. It requires volume data; without it, the indicator will not plot.

NOTES

This script is an alteration of TradingView's official VWAP indicator, adapted to a two-day period. It is provided for informational purposes only and does not constitute financial advice. Users assume all responsibility for their trading decisions and should conduct their own research.

2025-06-06 — Clarified and reformatted description to comply with TradingView House Rules.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.