OPEN-SOURCE SCRIPT
AVWAP TF_ATR

Advanced Multi-Source AVWAP with ATR Filters
This indicator is a versatile tool designed to calculate the Anchored Volume Weighted Average Price (AVWAP) from four different dynamic and manual sources. Unlike traditional AVWAPs that require manual repositioning, this script uses ATR-based volatility filters to automatically detect significant price pivots and volume spikes.
Key Features
1. Automated Swing High & Low Anchoring
The indicator scans the last N bars to find the highest and lowest points. To prevent "fake" pivots, it uses an ATR Filter Multiplier.
How it works: A new anchor is only set if the new high/low exceeds the previous one by a specific multiple of the Average True Range (ATR). This ensures that the AVWAP starts from a statistically significant trend reversal point.
2. Volume Spike Detection
Automatically starts a new AVWAP calculation when a massive influx of volume occurs.
Logic: It identifies bars where volume is significantly higher than the 20-period average AND the price range (High-Low) is wider than the ATR. This helps track the "average cost" of the institutional move that caused the breakout.
3. Manual Date Anchor
For traders who want to track the volume-weighted average from a specific event (Earnings, FOMC, Yearly Open), a manual date/time input is available.
4. Multi-Timeframe (MTF) Support
You can calculate AVWAP based on a higher timeframe (e.g., Daily AVWAP displayed on a 15m chart) while maintaining calculation precision.
Input Settings & Tooltips
AVWAP Timeframe: Set the calculation period. Tip: Should be equal to or higher than your chart timeframe.
ATR Period: Defines the lookback for volatility calculation (Default: 14).
Peak/Bottom ATR Filter: Increases the requirement for a new pivot. Higher values result in more stable, long-term AVWAP lines.
Volume Multiplier: Defines what constitutes a "spike" (e.g., 2.0x the average volume).
How to Trade with this Indicator
Dynamic Support/Resistance: The Swing Low AVWAP often acts as a strong support in an uptrend, while the Swing High AVWAP acts as resistance in a downtrend.
Trend Confirmation: If the price is trading above all three AVWAPs (Swing High, Low, and Date), the sentiment is strongly bullish.
Mean Reversion: Large deviations from the Volume Spike AVWAP often lead to a "snap-back" to the mean.
Alerts: The script includes built-in alerts for price crossings. You can set a single alert for "Any alert() function call" to be notified of any AVWAP breach.
Technical Details
Language: Pine Script v5
Overlay: Yes
Alerts: Dynamic crossing alerts for all active lines.
This indicator is a versatile tool designed to calculate the Anchored Volume Weighted Average Price (AVWAP) from four different dynamic and manual sources. Unlike traditional AVWAPs that require manual repositioning, this script uses ATR-based volatility filters to automatically detect significant price pivots and volume spikes.
Key Features
1. Automated Swing High & Low Anchoring
The indicator scans the last N bars to find the highest and lowest points. To prevent "fake" pivots, it uses an ATR Filter Multiplier.
How it works: A new anchor is only set if the new high/low exceeds the previous one by a specific multiple of the Average True Range (ATR). This ensures that the AVWAP starts from a statistically significant trend reversal point.
2. Volume Spike Detection
Automatically starts a new AVWAP calculation when a massive influx of volume occurs.
Logic: It identifies bars where volume is significantly higher than the 20-period average AND the price range (High-Low) is wider than the ATR. This helps track the "average cost" of the institutional move that caused the breakout.
3. Manual Date Anchor
For traders who want to track the volume-weighted average from a specific event (Earnings, FOMC, Yearly Open), a manual date/time input is available.
4. Multi-Timeframe (MTF) Support
You can calculate AVWAP based on a higher timeframe (e.g., Daily AVWAP displayed on a 15m chart) while maintaining calculation precision.
Input Settings & Tooltips
AVWAP Timeframe: Set the calculation period. Tip: Should be equal to or higher than your chart timeframe.
ATR Period: Defines the lookback for volatility calculation (Default: 14).
Peak/Bottom ATR Filter: Increases the requirement for a new pivot. Higher values result in more stable, long-term AVWAP lines.
Volume Multiplier: Defines what constitutes a "spike" (e.g., 2.0x the average volume).
How to Trade with this Indicator
Dynamic Support/Resistance: The Swing Low AVWAP often acts as a strong support in an uptrend, while the Swing High AVWAP acts as resistance in a downtrend.
Trend Confirmation: If the price is trading above all three AVWAPs (Swing High, Low, and Date), the sentiment is strongly bullish.
Mean Reversion: Large deviations from the Volume Spike AVWAP often lead to a "snap-back" to the mean.
Alerts: The script includes built-in alerts for price crossings. You can set a single alert for "Any alert() function call" to be notified of any AVWAP breach.
Technical Details
Language: Pine Script v5
Overlay: Yes
Alerts: Dynamic crossing alerts for all active lines.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.