OPEN-SOURCE SCRIPT
MACD Divergences HIST&LINE

**MACD Divergences HIST & LINE — Advanced Momentum Divergence Tool**
This indicator is designed to identify high-probability divergence setups using both the **MACD line** and **Histogram**, giving traders early signals and confirmation within one tool.
Built for precision and clarity, it detects **regular bullish and bearish divergences** by comparing price action with momentum shifts, helping traders spot potential reversals before they fully develop.
---
### 🔍 Key Features
• **Dual Divergence Engine**
Detects divergence on both:
* MACD Line (confirmation signals)
* Histogram (early momentum shifts)
• **Smart Pivot Detection**
Uses adaptive pivot logic to identify meaningful highs and lows while filtering out noise.
• **Zero-Line Filter (Optional)**
Improves signal quality by only allowing:
* Bullish setups below zero
* Bearish setups above zero
• **Customizable MACD Settings**
* Adjustable fast/slow lengths
* Selectable MA types (EMA or SMA)
* Fully configurable signal smoothing
• **Visual Clarity**
* Color-coded histogram momentum
* Clearly labeled bullish and bearish divergence zones
* Easy-to-read structure for fast decision making
---
### 📊 How to Use
**Bullish Divergence**
* Price forms a lower low
* MACD / Histogram forms a higher low
→ Indicates potential upside reversal
**Bearish Divergence**
* Price forms a higher high
* MACD / Histogram forms a lower high
→ Indicates potential downside reversal
For best results, combine with:
* Market structure (break of structure / trend shifts)
* Key support & resistance levels
* Volume confirmation
---
### ⚠️ Notes
This tool is designed to **assist decision-making**, not replace it.
Divergence is most effective when used within a broader trading strategy and proper risk management.
---
### 🚀 Ideal For
* Crypto traders
* Forex traders
* Intraday and swing trading
* Momentum and reversal strategies
---
**Stay disciplined. Trade with structure. Let momentum confirm your edge.**
This indicator is designed to identify high-probability divergence setups using both the **MACD line** and **Histogram**, giving traders early signals and confirmation within one tool.
Built for precision and clarity, it detects **regular bullish and bearish divergences** by comparing price action with momentum shifts, helping traders spot potential reversals before they fully develop.
---
### 🔍 Key Features
• **Dual Divergence Engine**
Detects divergence on both:
* MACD Line (confirmation signals)
* Histogram (early momentum shifts)
• **Smart Pivot Detection**
Uses adaptive pivot logic to identify meaningful highs and lows while filtering out noise.
• **Zero-Line Filter (Optional)**
Improves signal quality by only allowing:
* Bullish setups below zero
* Bearish setups above zero
• **Customizable MACD Settings**
* Adjustable fast/slow lengths
* Selectable MA types (EMA or SMA)
* Fully configurable signal smoothing
• **Visual Clarity**
* Color-coded histogram momentum
* Clearly labeled bullish and bearish divergence zones
* Easy-to-read structure for fast decision making
---
### 📊 How to Use
**Bullish Divergence**
* Price forms a lower low
* MACD / Histogram forms a higher low
→ Indicates potential upside reversal
**Bearish Divergence**
* Price forms a higher high
* MACD / Histogram forms a lower high
→ Indicates potential downside reversal
For best results, combine with:
* Market structure (break of structure / trend shifts)
* Key support & resistance levels
* Volume confirmation
---
### ⚠️ Notes
This tool is designed to **assist decision-making**, not replace it.
Divergence is most effective when used within a broader trading strategy and proper risk management.
---
### 🚀 Ideal For
* Crypto traders
* Forex traders
* Intraday and swing trading
* Momentum and reversal strategies
---
**Stay disciplined. Trade with structure. Let momentum confirm your edge.**
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.