OPEN-SOURCE SCRIPT

VWAP Divergence | dobofulop

Overview:
This script identifies potential bullish and bearish divergence signals using the Volume Weighted Average Price (VWAP). It calculates VWAP resets based on a selected “Anchor Period” (Session, Week, Month, Quarter, Year, Decade, Century, or corporate events like Earnings, Dividends, Splits). When price action and VWAP move in opposite directions with a sufficiently large ATR-based move over a chosen lookback period, the script plots divergence dots on the chart.


Key Features:
  1. VWAP Anchoring: Choose an anchor period for resetting VWAP. This could be daily, weekly, monthly, or based on specific corporate events (Earnings, Dividends, Splits).
  2. Divergence Detection: Looks for instances where the price is moving up while VWAP moves down (potential bullish divergence), and vice versa for bearish divergence.
  3. ATR Filter: Uses the ATR (Average True Range) to filter out minor or insignificant price moves, helping to reduce noise.
  4. Gap Check: Automatically invalidates signals if large price gaps occur within the lookback range.
  5. Visual Signals: Bullish divergences are plotted below the bar, while bearish divergences are plotted above, making it easy to spot potential reversal zones.



How to Us
  1. Inputs:
    - Anchor Period (Session, Week, Month, etc.) – determines when the VWAP calculation restarts.
    - Source (Default: HLC3) – Price source for the VWAP.
    - ATR Multiplier and Lookback Period – Fine-tune the threshold for detecting significant moves vs. VWAP.

  2. Interpretation:
    - Bullish Divergence Dot: Suggests potential price strength when price moves higher but VWAP moves lower.
    - Bearish Divergence Dot: Suggests potential price weakness when price moves lower but VWAP moves higher.



Disclaimer:

This script is provided for educational purposes only and should not be interpreted as financial advice. Past performance does not guarantee future results. Always conduct your own analysis and consider consulting a financial professional before making trading decisions.
Moving AveragesoscillaltorTrend AnalysisVolume Indicatorvwaposcillator

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明