# MACD Divergence

### What is MACD Divergence?

<mark style="color:$info;">The MACD Divergence module detects</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**bullish**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">and</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**bearish divergences**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">between price and the MACD oscillator. These divergences often appear before major price reversals and help traders catch early signals of trend exhaustion.</mark>

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FCmkn2xOuGvk5e4L7t9qb%2Fimage.png?alt=media&#x26;token=3b628cb7-e489-481e-b17e-5a924bbbbb1f" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">This is a</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**non-lagging system**</mark><mark style="color:$info;">. Divergences are detected in real time and plotted immediately after confirmation, with 1 bar delay.</mark>

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2Fn1JebiqsLwavzS1cJOnV%2Fimage.png?alt=media&#x26;token=75a24137-7d61-494f-a70a-aa60181bda9e" alt=""><figcaption></figcaption></figure>

* <mark style="color:$info;">**Bullish Divergence**</mark><mark style="color:$info;">: Price forms a lower low while MACD forms a higher low.</mark>
* <mark style="color:$info;">**Bearish Divergence**</mark><mark style="color:$info;">: Price forms a higher high while MACD forms a lower high.</mark>

<mark style="color:$info;">Visuals include:</mark>

* <mark style="color:$info;">Divergence lines on the MACD pane</mark>
* <mark style="color:$info;">Optional labels on the price chart</mark>

### Hidden Divergence (Trend Continuation)

<mark style="color:$info;">While regular divergence signals a potential trend reversal, Hidden Divergence is a powerful tool used to identify trend continuation.</mark>

&#x20;<mark style="color:$info;">It suggests that the current trend is gathering strength during a pullback and is likely to resume its original direction.</mark>

**How it Works**

* <mark style="color:$info;">Hidden Bullish Divergence: Occurs during an uptrend. Price forms a higher low, but the MACD oscillator forms a lower low.</mark>&#x20;

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2FfRnfTkL4KHSEyStAYjSj%2Fimage.png?alt=media&#x26;token=cb9ca424-df6d-4608-82dd-6be3257d1e76" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">This indicates that despite a deeper drop in momentum, the price floor is holding higher than before, signalling a high-probability continuation of the move up.</mark>

* <mark style="color:$info;">Hidden Bearish Divergence: Occurs during a downtrend. Price forms a lower high, but the MACD oscillator forms a higher high.</mark>&#x20;

<figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2Fw1TsaLHCU6Tuu9OK9gsi%2Fimage.png?alt=media&#x26;token=0bfe2233-5f0b-496b-b92d-8295c6e4cf3c" alt=""><figcaption></figcaption></figure>

<mark style="color:$info;">This indicates that even though momentum spiked higher, the price failed to break the previous peak, signaling a continuation of the move down.</mark>

### Settings

<mark style="color:$info;">Located in the</mark> <mark style="color:$info;"></mark><mark style="color:$info;">**MACD Divergence**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">section of the settings panel:</mark>

<div align="left" data-with-frame="true"><figure><img src="https://3353728891-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1dlOGDREop4WMfLcctYT%2Fuploads%2Fo6nYUpK1oRY90oJmKMyF%2Fimage.png?alt=media&#x26;token=da47b550-0439-42c0-b6d5-41300c45158f" alt=""><figcaption></figcaption></figure></div>

| Setting           | Description                                                                                                                                                          |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Divergence        | Toggle: Enable or disable divergence detection.                                                                                                                      |
| Divergence Length | <p>Length: Defines how far back the system looks for swing points.</p><p>Shorter: Faster, more frequent signals.</p><p>Longer: Slower, more macro-level signals.</p> |
| Regular Bullish   | Sets the color for standard bullish lines and labels (potential reversals).                                                                                          |
| Regular Bearish   | Sets the color for standard bearish lines and labels (potential reversals).                                                                                          |
| Hidden            | Enable or disable detection for Hidden Divergence (trend continuation).                                                                                              |
| Hidden Bullish    | Sets the color for hidden bullish lines and labels.                                                                                                                  |
| Hidden Bearish    | Sets the color for hidden bearish lines and labels.                                                                                                                  |
