Divergence Detection
The SMT/Divergence Suite detects four divergence types — regular bullish, hidden bullish, regular bearish, and hidden bearish — with both confirmed and early detection states. Advanced filtering through value conditions and point matching gives traders precise control over which divergences qualify as signals.
Divergence Types
Regular Divergences
Regular divergences signal that the current trend is losing momentum and a reversal may be approaching.

Regular Bullish: Price makes a lower low while the oscillator makes a higher low. The SMT/Divergence Suite draws a bullish divergence line connecting the two swing lows on both the oscillator and the price chart. This pattern suggests selling pressure is weakening despite lower prices.
Regular Bearish: Price makes a higher high while the oscillator makes a lower high. The SMT/Divergence Suite connects the swing highs with a bearish divergence line. This pattern indicates buying momentum is fading despite higher prices.
Hidden Divergences
Hidden divergences signal that the current trend has underlying strength and is likely to continue.

Hidden Bullish: Price makes a higher low while the oscillator makes a lower low. The trend is up, and despite the oscillator dip, price holds above the previous swing low — a sign of hidden buying strength.
Hidden Bearish: Price makes a lower high while the oscillator makes a higher high. The trend is down, and despite the oscillator rise, price stays below the previous swing high — a sign of hidden selling pressure.

Confirmation States
The SMT/Divergence Suite tracks two detection states for every divergence:
| State | When It Fires | Reliability | Alert Type |
|---|---|---|---|
| Early (Unconfirmed) | During bar formation, before close | Lower — signal may not hold | Bullish / Bearish Divergence |
| Confirmed | After bar close validates the swing point | Higher — swing point is finalized | Confirmed Bullish / Confirmed Bearish |
Early divergence signals give advance notice but can disappear if the bar closes differently. The SMT/Divergence Suite marks confirmed divergences only after the bar closes and the swing point is validated. Use confirmed signals for trade decisions and early signals for watchlist alerts.
Swing Detection Settings
The SMT/Divergence Suite identifies oscillator swing points using configurable detection parameters in the Swings Settings group. These settings control which points on the oscillator qualify for divergence matching.
Swing Style
| Style | How It Works | Best For |
|---|---|---|
| Standard | Counts bars on each side of a pivot point | General-purpose divergence detection on any instrument |
| Gann | Adds inside bar logic and breakout rules for cleaner pivot identification | Instruments with frequent consolidation (forex, indices) |
| Ticks | Measures minimum swing size in price ticks | Futures with defined tick values |
| Percent | Measures minimum swing size as a percentage of price | Comparing divergences across instruments with different price scales |
Core Parameters
| Setting | Default | What It Controls |
|---|---|---|
| Swing Size | 10 | Sensitivity of swing point detection — smaller values find more divergences, larger values find only major ones (1–300) |
| DTB Strength | 20 | Tolerance for double top/bottom matching — higher values allow more swing points to classify as equal highs or lows |
| Gann Settings | Ignore Inside Bars + Use Breakouts | Only applies when Gann swing style is selected — 4 configuration combinations for inside bar and breakout handling |
Advanced Filtering
Value Condition Filters
Available for bounded oscillators (CCI, RSI, MFI, Stochastic, Williams %R), Value Condition filters restrict divergence detection to specific oscillator zones. The SMT/Divergence Suite only triggers divergences when the oscillator meets the zone requirement.
| Filter | What It Does |
|---|---|
| Off | No zone restriction — divergences detected anywhere |
| Above Overbought | Only detect divergences when oscillator is above the OB threshold |
| Below Oversold | Only detect divergences when oscillator is below the OS threshold |
| Between Thresholds | Only detect divergences when oscillator is between OB and OS |
Point Matching
Point Matching controls which part of the divergence must meet the Value Condition:
| Option | What It Means |
|---|---|
| Only Start | The first swing point must be in the restricted zone |
| Only End | The second (current) swing point must be in the restricted zone |
| Both | Both swing points must be in the restricted zone |
Combine Value Condition "Below Oversold" with Point Matching "Only End" on RSI to detect bullish divergences only when the current RSI reading is in oversold territory. This filters out divergences that form in neutral zones where they have less predictive power.
Visualization Settings
| Setting | Default | What It Controls |
|---|---|---|
| Show on Main Chart | On | Draws divergence lines on the price chart overlay in addition to the oscillator pane |
| Line Style | Dotted | Style for divergence connecting lines (Solid, Dotted, Dashed) |
| Line Width | 3 | Thickness of divergence lines |
| Text Offset | 20 | Distance of divergence labels from the swing point — increase for busy charts |
Each divergence type has independent settings for:
- Enable/Disable toggle
- Label text (e.g., "bull reg", "bear hid")
- Color (blue for bullish, pink for bearish by default)
Alerts
The SMT/Divergence Suite provides four alert inputs:
| Alert | Default | What It Fires On |
|---|---|---|
| Confirmed Bullish | On | Bar-close-validated bullish divergence (regular or hidden) |
| Confirmed Bearish | On | Bar-close-validated bearish divergence (regular or hidden) |
| Bullish (early) | Off | Intrabar bullish divergence before bar close |
| Bearish (early) | Off | Intrabar bearish divergence before bar close |
To create an alert: enable the desired types in settings, right-click the indicator, select Add alert on SMT/Divergence Suite, and choose Any alert() function call.
FAQ
What is the difference between regular and hidden divergence in the SMT/Divergence Suite?
Regular divergences in the SMT/Divergence Suite signal potential trend reversals — price makes a new extreme while the oscillator fails to confirm it. Hidden divergences signal trend continuation — price holds a higher low (bullish) or lower high (bearish) while the oscillator moves against the trend. The SMT/Divergence Suite detects all four combinations independently.
What do the Value Condition filters do in the SMT/Divergence Suite?
Value Condition filters in the SMT/Divergence Suite restrict divergence detection to specific oscillator zones. "Above Overbought" only detects divergences when the oscillator is above the overbought threshold. "Below Oversold" restricts to oversold zones. "Between Thresholds" requires the oscillator between OB and OS levels. Available for CCI, RSI, MFI, Stochastic, and Williams %R.
How does the SMT/Divergence Suite confirm a divergence?
The SMT/Divergence Suite tracks two confirmation states. An early (unconfirmed) divergence appears as soon as a swing point match is detected during bar formation. A confirmed divergence fires after the bar closes and the swing point is validated. Use the Confirmed alert for higher-reliability signals and the early alert for advance notice.
What swing styles are available for divergence detection?
The SMT/Divergence Suite supports four swing detection styles: Standard (default — identifies swings using bar count on each side), Gann (adds inside bar and breakout rules for cleaner pivots), Ticks (measures swing size in price ticks), and Percent (measures swing size as a percentage of price). Each style changes which oscillator swing points qualify for divergence matching.