VWAP (Any Anchor)
Oct 23, 2023

The VWAP (Any Anchor) indicator provides a highly flexible version of the Volume Weighted Average Price by allowing users to reset the calculation based on a wide variety of custom time-based and event-based triggers. This tool is designed to help traders identify the average price weighted by volume starting from specific market milestones, offering deeper insights into trend strength and institutional positioning.
Usage
The Usage section highlights the versatility of the anchoring mechanism. By selecting different anchor points, traders can adapt the VWAP to various market conditions:
- Intraday Trading: Use time-based anchors like "8am" or "Weekly NY Open" to see how price interacts with the volume profile of the current session or week.
- Momentum Trading: Use event-based anchors such as "3 Consecutive Green Candles" or "Supertrend" direction changes to start the VWAP calculation exactly when a momentum shift is detected.
- Custom Integration: Utilize the "External Connector" option to link the VWAP reset to a signal from another script. For example, if you have a separate strategy script that outputs a signal, you can anchor this VWAP to those specific entries.
Details
The script functions by calculating the cumulative sum of price multiplied by volume, divided by the cumulative volume, starting fresh whenever the selected "Anchor Period" condition is met.
- Multi-Timeframe Support: The indicator includes a timeframe setting, allowing you to plot a VWAP from a higher timeframe onto your current chart.
- Event Logic: The "Supertrend" anchor specifically triggers when the Supertrend direction flips from bearish to bullish. The "7 Rising Candles" logic looks for clusters of bullish activity within a 10-bar lookback to identify significant trend starts.
Settings
VWAP Settings
- Hide VWAP on 1D or Above: When enabled, the indicator will not plot on Daily, Weekly, or Monthly timeframes to keep higher timeframe charts clean.
- Anchor Period: Select the trigger for resetting the VWAP calculation (e.g., specific times, candle patterns, or Supertrend flips).
- Source: The price input used for the calculation (default is HLC3).
- VWAP Timeframe: Allows the calculation to be derived from a specific timeframe.
- Color / Text Color: Customizes the visual appearance of the VWAP line and the price label.
- Label Position: Adjusts the horizontal offset of the price label on the right side of the chart.
- Offset: Shifts the VWAP plot forward in time.
- External Connector: Input source to be used when the "External Connector" anchor is selected.
FAQ
How do I use a signal from another script to anchor this VWAP?
Set the "Anchor Period" to "External Connector" and then use the "External Connector" source input to select the plot or signal output from your desired secondary script.
Why is the VWAP not showing on my Daily chart?
Check the "Hide VWAP on 1D or Above" setting in the inputs. If this is checked, the script automatically disables the plot on daily and higher timeframes.
How can I access the VWAP (Any Anchor)?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.