OPEN-SOURCE SCRIPT
VWAP + Engulfing Candles

Here’s a clear breakdown of what your merged Pine Script does:
---
### 📌 **Indicator Name: VWAP + Engulfing Candles**
* This custom TradingView indicator **plots VWAP (Volume Weighted Average Price)** along with **up to 3 dynamic bands** around it.
* It also **detects Bullish and Bearish Engulfing Candlestick Patterns**, displaying visual markers and triggering alerts.
---
## 🔹 **1. VWAP Section**
### ➤ **Main Features:**
* Calculates VWAP anchored to a **customizable time period**:
* Options: Session, Week, Month, Quarter, Year, Decade, Century, Earnings, Dividends, Splits.
* Optional **hiding of VWAP on Daily/Weekly/Monthly charts** to reduce clutter.
### ➤ **Bands Around VWAP:**
* Up to **3 bands** can be plotted above and below the VWAP.
* Bands can be based on either:
* **Standard Deviation** of the price from VWAP (volatility-based), or
* **Percentage** deviation from VWAP (fixed range).
* You can control:
* Whether each band is shown
* Band width via multiplier (e.g., 1x, 2x, 3x)
### ➤ **Plot Colors:**
* VWAP: Blue
* Bands: Green (1x), Olive (2x), Teal (3x)
* Band fill areas are semi-transparent.
---
## 🔹 **2. Engulfing Candlestick Pattern Detector**
### ➤ **Bullish Engulfing Criteria:**
* Current candle opens **below** or **equal to** the close of the previous candle.
* Current candle opens **below** the previous candle's open.
* Current candle closes **above** the previous candle’s open.
### ➤ **Bearish Engulfing Criteria:**
* Current candle opens **above** or **equal to** the close of the previous candle.
* Current candle opens **above** the previous candle’s open.
* Current candle closes **below** the previous candle’s open.
### ➤ **Visual Signals:**
* 🔼 Green triangle **below bar** for **Bullish Engulfing**
* 🔽 Red triangle **above bar** for **Bearish Engulfing**
### ➤ **Alerts:**
* The script includes two alert conditions:
* One for Bullish Engulfing
* One for Bearish Engulfing
These alerts can be used to automate notifications for potential reversal points.
---
## 🛠️ **Use Cases**
* **Trend following or reversal spotting**: VWAP helps identify the average trading price; engulfing patterns often signal reversals.
* **Intraday and swing trading**: Works best on timeframes like 5m, 15m, 1h for intraday, or 4h, 1D for swing.
* **Mean reversion strategies**: Bands help spot overbought/oversold areas relative to VWAP.
---
### 📌 **Indicator Name: VWAP + Engulfing Candles**
* This custom TradingView indicator **plots VWAP (Volume Weighted Average Price)** along with **up to 3 dynamic bands** around it.
* It also **detects Bullish and Bearish Engulfing Candlestick Patterns**, displaying visual markers and triggering alerts.
---
## 🔹 **1. VWAP Section**
### ➤ **Main Features:**
* Calculates VWAP anchored to a **customizable time period**:
* Options: Session, Week, Month, Quarter, Year, Decade, Century, Earnings, Dividends, Splits.
* Optional **hiding of VWAP on Daily/Weekly/Monthly charts** to reduce clutter.
### ➤ **Bands Around VWAP:**
* Up to **3 bands** can be plotted above and below the VWAP.
* Bands can be based on either:
* **Standard Deviation** of the price from VWAP (volatility-based), or
* **Percentage** deviation from VWAP (fixed range).
* You can control:
* Whether each band is shown
* Band width via multiplier (e.g., 1x, 2x, 3x)
### ➤ **Plot Colors:**
* VWAP: Blue
* Bands: Green (1x), Olive (2x), Teal (3x)
* Band fill areas are semi-transparent.
---
## 🔹 **2. Engulfing Candlestick Pattern Detector**
### ➤ **Bullish Engulfing Criteria:**
* Current candle opens **below** or **equal to** the close of the previous candle.
* Current candle opens **below** the previous candle's open.
* Current candle closes **above** the previous candle’s open.
### ➤ **Bearish Engulfing Criteria:**
* Current candle opens **above** or **equal to** the close of the previous candle.
* Current candle opens **above** the previous candle’s open.
* Current candle closes **below** the previous candle’s open.
### ➤ **Visual Signals:**
* 🔼 Green triangle **below bar** for **Bullish Engulfing**
* 🔽 Red triangle **above bar** for **Bearish Engulfing**
### ➤ **Alerts:**
* The script includes two alert conditions:
* One for Bullish Engulfing
* One for Bearish Engulfing
These alerts can be used to automate notifications for potential reversal points.
---
## 🛠️ **Use Cases**
* **Trend following or reversal spotting**: VWAP helps identify the average trading price; engulfing patterns often signal reversals.
* **Intraday and swing trading**: Works best on timeframes like 5m, 15m, 1h for intraday, or 4h, 1D for swing.
* **Mean reversion strategies**: Bands help spot overbought/oversold areas relative to VWAP.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.