OPEN-SOURCE SCRIPT
已更新 VWAP [cryptalent]

VWAP Indicator with Adjustable Source
Overview
This TradingView indicator calculates Daily, Weekly, and Monthly VWAP (Volume Weighted Average Price) with the flexibility to select different price sources (Open, High, Low, Close, HLC3, etc.). It also displays previous period VWAP levels, helping traders analyze past liquidity zones.
Key Features:
✅ Adjustable Source – Users can choose the price used for VWAP calculations (e.g., Close, High, Low, Open).
✅ Multi-Timeframe VWAP – Tracks Daily, Weekly, and Monthly VWAP to provide a broader market view.
✅ Historical VWAP Levels – Displays previous VWAP values for comparison and reference.
✅ Step Line Style – Ensures clear distinction between different periods and prevents overlapping.
✅ Visible in the Price Scale – The latest and historical VWAP values are displayed in the right-hand price scale for easy reference.
Customization:
You can easily modify the input settings to match your trading style.
Adjust the VWAP source price to test different perspectives (e.g., Open vs. High vs. Close).
Overview
This TradingView indicator calculates Daily, Weekly, and Monthly VWAP (Volume Weighted Average Price) with the flexibility to select different price sources (Open, High, Low, Close, HLC3, etc.). It also displays previous period VWAP levels, helping traders analyze past liquidity zones.
Key Features:
✅ Adjustable Source – Users can choose the price used for VWAP calculations (e.g., Close, High, Low, Open).
✅ Multi-Timeframe VWAP – Tracks Daily, Weekly, and Monthly VWAP to provide a broader market view.
✅ Historical VWAP Levels – Displays previous VWAP values for comparison and reference.
✅ Step Line Style – Ensures clear distinction between different periods and prevents overlapping.
✅ Visible in the Price Scale – The latest and historical VWAP values are displayed in the right-hand price scale for easy reference.
Customization:
You can easily modify the input settings to match your trading style.
Adjust the VWAP source price to test different perspectives (e.g., Open vs. High vs. Close).
發行說明
Optimized alert options發行說明
📋 Feature Description for TradingView PublicationVWAP Touch Alert SystemThis indicator now includes an advanced D/W/M VWAP Touch Alert System with intelligent cooldown mechanism to prevent alert fatigue.✨ Key Features1. VWAP Touch DetectionTriggers when price touches Daily, Weekly, or Monthly VWAP levels
Detects touch via candlestick's High/Low range (includes both body and wicks)
Separate alerts for each timeframe (D/W/M)
2. Smart Cooldown Mechanism
One alert per bar - prevents multiple alerts on the same candle
Independent cooldown tracking for each VWAP period
Next alert only triggers on a new completed bar
3. Flexible Alert Configuration
Individual toggles for D/W/M touch alerts
Combined alert option: "Any D/W/M VWAP Touch"
Full integration with existing Cross and Std Dev Band alerts
🔔 Alert SettingsTouch Alerts - D/W/M
Daily VWAP Touch Alert - Alert when price touches Daily VWAP (max once per bar)
Weekly VWAP Touch Alert - Alert when price touches Weekly VWAP (max once per bar)
Monthly VWAP Touch Alert - Alert when price touches Monthly VWAP (max once per bar)
Combined Alerts
Any D/W/M VWAP Touch - Triggers on any D/W/M VWAP touch event
Any VWAP Pro Signal - Master alert including all Cross, Touch, and Std Dev events
📖 How to UseStep 1: Enable Desired Alerts
Navigate to indicator settings → "Touch Alerts - D/W/M" group → Enable your preferred alertsStep 2: Create Alert in TradingView
Click "Add Alert" on the chart
Select from available alert conditions:
Individual: Daily VWAP Touch, Weekly VWAP Touch, Monthly VWAP Touch
Combined: Any D/W/M VWAP Touch
Configure notification settings (email, webhook, push notification)
Step 3: Alert Message Format
Touch alerts display with 🎯 emoji for easy identification:
🎯 Daily VWAP Touch | Price: 43250.50
🎯 Weekly VWAP Touch | Price: 43250.50⚙️ Technical ImplementationTouch Detection Logic:
Touch Condition = (Low <= VWAP) AND (High >= VWAP) AND (VWAP is valid)Cooldown Mechanism:
Tracks bar_index of last alert trigger for each period
Alert only fires when current_bar_index ≠ last_triggered_bar_index
Prevents duplicate alerts on rapid price oscillations around VWAP
Performance:
Uses var keyword for efficient state management
Minimal computational overhead
Works seamlessly across all timeframes (1m to 1D+)
🎯 Use Cases
Mean Reversion Trading - Alert when price returns to VWAP anchors
Breakout Confirmation - Monitor when price respects or rejects key VWAP levels
Multi-Timeframe Analysis - Track D/W/M VWAP touches simultaneously
Risk Management - Use VWAP touches as dynamic support/resistance zones
📌 Notes
Touch alerts are additive to existing Cross alerts (both can be enabled simultaneously)
Cooldown prevents alert spam while maintaining high sensitivity
Each VWAP period (D/W/M) has independent cooldown tracking
Compatible with all alert delivery methods (app, email, webhook)
🔄 Version Historyv2.0 - VWAP Touch Alerts
Added D/W/M VWAP touch detection
Implemented per-bar cooldown mechanism
Enhanced alert message system with touch events
Added 4 new alertcondition() entries for TradingView alert panel
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。