OPEN-SOURCE SCRIPT
VWAP-Anchored MACD [BOSWaves]

VWAP-Anchored MACD [BOSWaves] - Volume-Weighted Momentum Mapping With Zero-Line Filtering
Overview
The VWAP-Anchored MACD [BOSWaves] delivers a refined momentum model built on volume-weighted price rather than raw closes, giving you a more grounded view of trend strength during sessions, weeks, or months.

Instead of tracking two EMAs of price like a standard MACD, this tool reconstructs the MACD engine using anchored VWAP as the core input. The result is a momentum structure that reacts to real liquidity flow, filters out weak crossovers near the zero line, and visualizes acceleration shifts with clear, high-contrast gradients.
This indicator acts as a precise momentum map that adapts in real time. You see how weighted price is accelerating, where valid crossovers form, and when trend conviction is strong enough to justify execution.
It uses gradient line coloring to show bullish or bearish momentum, histogram shading to highlight energy shifts, cross dots to mark valid crossovers, optional buy/sell diamonds for execution cues, and candle coloring to display trend strength at a glance.
Theoretical Foundation
Traditional MACD compares the difference between two exponential moving averages of price.
This variant replaces price with anchored VWAP, making the calculation sensitive to actual traded volume across your chosen period (Session, Week, or Month).
Three principles drive the logic:
Anchoring VWAP to session, weekly, or monthly resets creates a systematic framework for tracking how capital flow is driving momentum throughout each trading cycle.
How It Works
The core engine processes momentum through several mapped layers:
This layered structure ensures you always know whether momentum is strengthening, fading, or transitioning.
Interpretation
You get a clean, structural understanding of VWAP-based momentum:
This creates a more disciplined version of MACD momentum reading - less noise, more conviction, and better alignment with liquidity.
Strategy Integration
This indicator slots cleanly into any momentum-following system and offers higher signal quality than classic MACD variants due to the volume-weighted core.
Technical Implementation Details
Optimal Application Parameters
Timeframes:
Suggested Configuration:
These suggested parameters should be used as a baseline; their effectiveness depends on the asset volatility, liquidity, and preferred entry frequency, so fine-tuning is expected for optimal performance.
Performance Characteristics
High Effectiveness:
Reduced Effectiveness:
Disclaimer
The VWAP-Anchored MACD [BOSWaves] is a structural momentum tool designed to enhance directional clarity - not a guaranteed predictor. Performance depends on market regime, volatility, and disciplined execution. Use it alongside broader trend, volume, and structural analysis for optimal results.
Overview
The VWAP-Anchored MACD [BOSWaves] delivers a refined momentum model built on volume-weighted price rather than raw closes, giving you a more grounded view of trend strength during sessions, weeks, or months.
Instead of tracking two EMAs of price like a standard MACD, this tool reconstructs the MACD engine using anchored VWAP as the core input. The result is a momentum structure that reacts to real liquidity flow, filters out weak crossovers near the zero line, and visualizes acceleration shifts with clear, high-contrast gradients.
This indicator acts as a precise momentum map that adapts in real time. You see how weighted price is accelerating, where valid crossovers form, and when trend conviction is strong enough to justify execution.
It uses gradient line coloring to show bullish or bearish momentum, histogram shading to highlight energy shifts, cross dots to mark valid crossovers, optional buy/sell diamonds for execution cues, and candle coloring to display trend strength at a glance.
Theoretical Foundation
Traditional MACD compares the difference between two exponential moving averages of price.
This variant replaces price with anchored VWAP, making the calculation sensitive to actual traded volume across your chosen period (Session, Week, or Month).
Three principles drive the logic:
- Anchored VWAP Momentum: Price is weighted by volume and aggregated across the selected anchor. The fast and slow VWAP-EMAs then expose how liquidity-corrected momentum is expanding or contracting.
- Zero-Line Distance Filtering: Crossover signals that occur too close to the zero line are removed. This eliminates the common MACD problem of generating weak, directionless signals in choppy phases.
- Directional Visualization: MACD line, signal line, histogram, candle colors, and optional diamond markers all react to shifts in VWAP-momentum, giving you a clean structural read on market pressure.
Anchoring VWAP to session, weekly, or monthly resets creates a systematic framework for tracking how capital flow is driving momentum throughout each trading cycle.
How It Works
The core engine processes momentum through several mapped layers:
- VWAP Aggregation: Price × volume is accumulated until the anchor resets. This creates a continuous, liquidity-corrected VWAP curve.
- MACD Construction: Fast and slow VWAP-EMAs define the MACD line, while a smoothed signal line identifies edges where momentum shifts.
- Zero-Line Distance Filter: MACD and signal must both exceed a threshold distance from zero for a crossover to count as valid. This prevents fake crossovers during compression.
- Visual Momentum Layers: It uses gradient line coloring to show bullish or bearish momentum, histogram shading to highlight energy shifts, cross dots to mark valid crossovers, optional buy/sell diamonds for execution cues, and candle coloring to display trend strength at a glance.
This layered structure ensures you always know whether momentum is strengthening, fading, or transitioning.
Interpretation
You get a clean, structural understanding of VWAP-based momentum:
- Bullish Phases: MACD > Signal, histogram expands, candles turn bullish, and crossovers occur above the threshold.
- Bearish Phases: MACD < Signal, histogram drives lower, candles shift bearish, and downward crossovers trigger below the threshold.
- Neutral/Compression: Both lines remain near the zero boundary, histogram flattens, and signals are suppressed to avoid noise.
This creates a more disciplined version of MACD momentum reading - less noise, more conviction, and better alignment with liquidity.
Strategy Integration
- Trend Continuation: Use VWAP-MACD crossovers that occur far from the zero line as higher-conviction entries.
- Zero-Line Rejection: Watch for histogram contractions near zero to anticipate flattening momentum and potential reversal setups.
- Session/Week/Month Anchors: Session anchor works best for intraday flows. Weekly or monthly anchor structures create cleaner macro momentum reads for swing trading.
- Signal-Only Execution: Optional buy/sell diamonds give you direct points to trigger trades without overanalyzing the chart.
This indicator slots cleanly into any momentum-following system and offers higher signal quality than classic MACD variants due to the volume-weighted core.
Technical Implementation Details
- VWAP Reset Logic: Session (D), Week (W), or Month (M)
- Dynamic Fast/Slow VWAP EMAs: Fully configurable lengths, smoothing and anchor settings
- MACD/Signal Line Framework: Traditional structure with volume-anchored input
- Zero-Line Filtering: Adjustable threshold for structural confirmation
- Dual Visualization Layers: MACD body + histogram + crosses + candle coloring
- Optimized Performance: Lightweight, fast rendering across all timeframes
Optimal Application Parameters
Timeframes:
- 1- 15 min: Short-term momentum scalping and rapid trend shifts
- 30- 240 min: Balanced momentum mapping with clear structural filtering
- Daily: Macro VWAP regime identification
Suggested Configuration:
- Fast Length: 12
- Slow Length: 26
- Signal Length: 9
- Zero Threshold: 200 - 500 depending on asset range
These suggested parameters should be used as a baseline; their effectiveness depends on the asset volatility, liquidity, and preferred entry frequency, so fine-tuning is expected for optimal performance.
Performance Characteristics
High Effectiveness:
- Assets with strong intraday or session-based volume cycles
- Markets where volume-weighted momentum leads price swings
- Trend environments with strong acceleration
Reduced Effectiveness:
- Ultra-choppy markets hugging the VWAP axis
- Sessions with abnormally low volume
- Ranges where MACD naturally compresses
Disclaimer
The VWAP-Anchored MACD [BOSWaves] is a structural momentum tool designed to enhance directional clarity - not a guaranteed predictor. Performance depends on market regime, volatility, and disciplined execution. Use it alongside broader trend, volume, and structural analysis for optimal results.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。