# divergence

## What Is Divergence?

Divergence occurs when **price and an indicator move in opposite directions**. It signals that the current price move is losing internal support — the underlying Momentum, Expansion Wave, or Order Flow is not confirming what price is doing.

In Synergy Signal, divergences are detected on three independent sources and contribute a **soft score boost** to the signal engine. They never block entries on their own.

## Types of Divergence Detected

### Bullish Divergence (Long Signal Boost)

Price makes a **lower low** while an indicator makes a **higher low**. Sellers are losing momentum even as price drops — a reversal may be forming.

| Type                  | Setting Name              | Price     | Indicator                            |
| --------------------- | ------------------------- | --------- | ------------------------------------ |
| Momentum Divergence   | Use Momentum Divs         | Lower low | Momentum line higher low             |
| Expansion Divergence  | Use Expansion Divergence  | Lower low | Expansion Wave bull value higher low |
| Order Flow Divergence | Use Order Flow Divergence | Lower low | Order Flow value higher low          |

### Bearish Divergence (Short Signal Boost)

Price makes a **higher high** while an indicator makes a **lower high**. Buyers are losing momentum even as price rises.

| Type                  | Setting Name              | Price       | Indicator                            |
| --------------------- | ------------------------- | ----------- | ------------------------------------ |
| Momentum Divergence   | Use Momentum Divs         | Higher high | Momentum line lower high             |
| Expansion Divergence  | Use Expansion Divergence  | Higher high | Expansion Wave bear value lower high |
| Order Flow Divergence | Use Order Flow Divergence | Higher high | Order Flow value lower high          |

## How Detection Works

The indicator uses **pivot points** to identify swing highs and lows:

* A **pivot low** is a bar whose low is lower than the 2 bars to its left and 2 bars to its right
* A **pivot high** is a bar whose high is higher than the 2 bars to its left and 2 bars to its right

When a new pivot forms, the indicator compares it to the previous pivot. If price makes a lower low but the indicator makes a higher low → bullish divergence detected.

### Age Limit

Divergences are only counted if both pivots occurred within the last **120 bars**. Older divergences are discarded as stale.

### Freshness Window

Once a divergence is detected at a pivot, it remains active for the number of bars set in **Divergence Fresh Bars** (default 20). This keeps the divergence score active during the window when price typically reacts.

{% hint style="info" %}
**Note:** Pivot points are confirmed 2 bars after they form. This means a divergence detected at a pivot is already 2 bars old when it registers. Set Divergence Fresh Bars to at least 5–10 to ensure the boost is active when the signal fires.
{% endhint %}

## Settings (Divergence Section in UI)

| Setting                   | Default | Description                                                     |
| ------------------------- | ------- | --------------------------------------------------------------- |
| Use Momentum Divs         | ✅ On    | Detect divergences on the Momentum line                         |
| Use Expansion Divergence  | ✅ On    | Detect divergences on the Expansion Wave                        |
| Use Order Flow Divergence | ✅ On    | Detect divergences on the Order Flow bars                       |
| Min Divergences Required  | 1       | How many divergence types must fire before any points are added |
| Divergence Fresh Bars     | 20      | How many bars a detected divergence remains active              |

## Min Divergences Required

This controls how many divergence types must agree before the pillar contributes to the score:

| Value | Behavior                                           |
| ----- | -------------------------------------------------- |
| 1     | Any single divergence type activates the pillar    |
| 2     | Two types must agree (e.g., Momentum + Order Flow) |
| 3     | All three types must agree simultaneously          |

Each active divergence type contributes its individual point to the score. Setting Min Divergences Required to 2 ensures at least 2 types are present before any divergence points are added.

## Divergence as a Soft Pillar

A key design principle: divergences **add score points but never block entries**. A strong setup with Expansion Wave + Momentum + Order Flow all aligned should still fire even if no divergence is present. Divergence is a **bonus confirmation** — not a prerequisite.

When divergence IS present alongside strong hard-pillar confluence, the total score rises and the setup carries more weight.

## Tips

* Set **Divergence Fresh Bars** higher (40–60) on higher timeframes (4H, Daily) where pivots take more bars to form and confirm.
* On fast timeframes (1m, 5m), divergences can be noisy. Set **Min Divergences Required** to 2 to require more agreement before counting any divergence points.
* **Triple divergence** (all three types firing simultaneously) is a particularly powerful setup, especially when it coincides with the hard-pillar conditions.
* To effectively remove divergence from scoring without adjusting Min Score, disable all three divergence toggles (Use Momentum Divs, Use Expansion Divergence, Use Order Flow Divergence).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.synergysignal.io/divergence.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
