OPEN-SOURCE SCRIPT
DV

This indicator is a **volatility-adaptive, swing point-anchored dynamic VWAP** that resets calculations at key swing highs/lows. It delivers strong trend-following performance and is ideal for trend identification, dynamic support/resistance analysis, and swing trading.
---
## 1. Core Features
1. Automatically detects **key swing highs and lows** and labels trend structure with **HH/HL/LH/LL**.
2. Dynamically resets VWAP anchored at swing points, replacing the fixed-anchor logic of traditional VWAP.
3. Optional **volatility adaptation**: VWAP becomes more responsive in high volatility and smoother in ranging markets.
4. Color-coded VWAP lines clearly distinguish bullish/bearish trends and visualize dynamic SR levels.
---
## 2. Parameter Explanation
### Swing Points
| Parameter | Name | Description | Recommended Setting |
|-----------|------|-------------|---------------------|
| Swing Period | Swing Detection Period | Defines the lookback period for swing points. Larger values = more significant swings & slower response; smaller values = more frequent signals & higher noise. | 50 (Default) |
| Adaptive Price Tracking | Base Responsiveness | Controls how tightly VWAP follows price. Lower = more responsive; higher = smoother. | 20 (Default) |
| Adapt APT by ATR ratio | Volatility Adaptation Switch | When enabled, VWAP speed auto-adjusts to market volatility. | Off for trends, On for ranging markets |
| Volatility Bias | Volatility Sensitivity | Strength of volatility impact on VWAP speed. >1 = stronger effect; <1 = weaker effect. | 10.0 (Default) |
### Style Settings
| Parameter | Function |
|-----------|----------|
| Swing Labels (High) | Color for swing high labels (default: lime) |
| Swing Labels (Low) | Color for swing low labels (default: red) |
| VWAP Lines (Up) | Color for bullish VWAP |
| VWAP Lines (Down) | Color for bearish VWAP |
| VWAP Line Width | Thickness of VWAP line (default: 2) |
---
## 3. Chart Signal Interpretation
### Swing Point Labels
- **HH (Higher High)**: Price makes a new high – strong bullish momentum
- **HL (Higher Low)**: Higher swing low – healthy uptrend
- **LH (Lower High)**: Lower swing high – bearish structure
- **LL (Lower Low)**: Price makes a new low – strong bearish momentum
### VWAP Line Meaning
- **Lime line**: Bullish trend (anchored at recent swing low)
- **Red line**: Bearish trend (anchored at recent swing high)
- **Tight VWAP (close to price)**: High volatility or fast responsiveness
- **Smooth VWAP (away from price)**: Low volatility or slow responsiveness
---
## 4. Practical Trading Applications
### 1. Trend Identification (Primary Use)
- Lime VWAP + consecutive HH/HL → **strong uptrend**: use VWAP as dynamic support for long entries.
- Red VWAP + consecutive LH/LL → **strong downtrend**: use VWAP as dynamic resistance for short entries.
### 2. Dynamic Support & Resistance
- Uptrend: VWAP acts as **strong dynamic support** – buy on retests that hold.
- Downtrend: VWAP acts as **strong dynamic resistance** – sell on rejections.
### 3. Volatility Adaptation Usage
- **High volatility (strong trends)**: Enable “Adapt APT by ATR ratio” for faster VWAP tracking.
- **Low volatility (ranging markets)**: Disable adaptation for stable, less whipsawed VWAP.
### 4. Trend Reversal Signal
- Sharp color shift (red → lime or lime → red) + new swing point = **potential trend reversal**.
---
## 5. Compatible Timeframes & Assets
- **Timeframes**: 15min, 1H, 4H, Daily (short-term: 15min/1H; swing trading: 4H/Daily)
- **Assets**: Stocks, futures, crypto, forex, and all price-charted instruments.
---
## 6. Important Notes
1. Larger swing periods = fewer but more reliable signals; smaller periods = more signals but more noise.
2. VWAP is a **dynamic SR tool**, not a standalone entry signal. Use with price action and volume confirmation.
3. The indicator auto-cleans old labels and lines to avoid drawing-limit errors.
4. Runs exclusively on TradingView Pine Script v6.
---
## 7. Quick Start Guide
1. Copy the code → create a new Pine Script on TradingView → paste and save.
2. Use default settings for immediate application (no tuning needed for beginners).
3. Use VWAP color for trend direction; use HH/HL/LH/LL to confirm structure.
4. Trade in the direction of the trend on bounces off the dynamic VWAP.
---
## 1. Core Features
1. Automatically detects **key swing highs and lows** and labels trend structure with **HH/HL/LH/LL**.
2. Dynamically resets VWAP anchored at swing points, replacing the fixed-anchor logic of traditional VWAP.
3. Optional **volatility adaptation**: VWAP becomes more responsive in high volatility and smoother in ranging markets.
4. Color-coded VWAP lines clearly distinguish bullish/bearish trends and visualize dynamic SR levels.
---
## 2. Parameter Explanation
### Swing Points
| Parameter | Name | Description | Recommended Setting |
|-----------|------|-------------|---------------------|
| Swing Period | Swing Detection Period | Defines the lookback period for swing points. Larger values = more significant swings & slower response; smaller values = more frequent signals & higher noise. | 50 (Default) |
| Adaptive Price Tracking | Base Responsiveness | Controls how tightly VWAP follows price. Lower = more responsive; higher = smoother. | 20 (Default) |
| Adapt APT by ATR ratio | Volatility Adaptation Switch | When enabled, VWAP speed auto-adjusts to market volatility. | Off for trends, On for ranging markets |
| Volatility Bias | Volatility Sensitivity | Strength of volatility impact on VWAP speed. >1 = stronger effect; <1 = weaker effect. | 10.0 (Default) |
### Style Settings
| Parameter | Function |
|-----------|----------|
| Swing Labels (High) | Color for swing high labels (default: lime) |
| Swing Labels (Low) | Color for swing low labels (default: red) |
| VWAP Lines (Up) | Color for bullish VWAP |
| VWAP Lines (Down) | Color for bearish VWAP |
| VWAP Line Width | Thickness of VWAP line (default: 2) |
---
## 3. Chart Signal Interpretation
### Swing Point Labels
- **HH (Higher High)**: Price makes a new high – strong bullish momentum
- **HL (Higher Low)**: Higher swing low – healthy uptrend
- **LH (Lower High)**: Lower swing high – bearish structure
- **LL (Lower Low)**: Price makes a new low – strong bearish momentum
### VWAP Line Meaning
- **Lime line**: Bullish trend (anchored at recent swing low)
- **Red line**: Bearish trend (anchored at recent swing high)
- **Tight VWAP (close to price)**: High volatility or fast responsiveness
- **Smooth VWAP (away from price)**: Low volatility or slow responsiveness
---
## 4. Practical Trading Applications
### 1. Trend Identification (Primary Use)
- Lime VWAP + consecutive HH/HL → **strong uptrend**: use VWAP as dynamic support for long entries.
- Red VWAP + consecutive LH/LL → **strong downtrend**: use VWAP as dynamic resistance for short entries.
### 2. Dynamic Support & Resistance
- Uptrend: VWAP acts as **strong dynamic support** – buy on retests that hold.
- Downtrend: VWAP acts as **strong dynamic resistance** – sell on rejections.
### 3. Volatility Adaptation Usage
- **High volatility (strong trends)**: Enable “Adapt APT by ATR ratio” for faster VWAP tracking.
- **Low volatility (ranging markets)**: Disable adaptation for stable, less whipsawed VWAP.
### 4. Trend Reversal Signal
- Sharp color shift (red → lime or lime → red) + new swing point = **potential trend reversal**.
---
## 5. Compatible Timeframes & Assets
- **Timeframes**: 15min, 1H, 4H, Daily (short-term: 15min/1H; swing trading: 4H/Daily)
- **Assets**: Stocks, futures, crypto, forex, and all price-charted instruments.
---
## 6. Important Notes
1. Larger swing periods = fewer but more reliable signals; smaller periods = more signals but more noise.
2. VWAP is a **dynamic SR tool**, not a standalone entry signal. Use with price action and volume confirmation.
3. The indicator auto-cleans old labels and lines to avoid drawing-limit errors.
4. Runs exclusively on TradingView Pine Script v6.
---
## 7. Quick Start Guide
1. Copy the code → create a new Pine Script on TradingView → paste and save.
2. Use default settings for immediate application (no tuning needed for beginners).
3. Use VWAP color for trend direction; use HH/HL/LH/LL to confirm structure.
4. Trade in the direction of the trend on bounces off the dynamic VWAP.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.