Skip to main content

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.

SMT/Divergence Suite showing regular divergence with RSI — price vs oscillator comparison

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.

SMT/Divergence Suite showing hidden divergence — bullish and bearish examples

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.

SMT/Divergence Suite with Stoch RSI showing both bearish hidden and bullish hidden divergences on BTCUSDT

Confirmation States

The SMT/Divergence Suite tracks two detection states for every divergence:

StateWhen It FiresReliabilityAlert Type
Early (Unconfirmed)During bar formation, before closeLower — signal may not holdBullish / Bearish Divergence
ConfirmedAfter bar close validates the swing pointHigher — swing point is finalizedConfirmed Bullish / Confirmed Bearish
Use Confirmed Signals for Trading

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

StyleHow It WorksBest For
StandardCounts bars on each side of a pivot pointGeneral-purpose divergence detection on any instrument
GannAdds inside bar logic and breakout rules for cleaner pivot identificationInstruments with frequent consolidation (forex, indices)
TicksMeasures minimum swing size in price ticksFutures with defined tick values
PercentMeasures minimum swing size as a percentage of priceComparing divergences across instruments with different price scales

Core Parameters

SettingDefaultWhat It Controls
Swing Size10Sensitivity of swing point detection — smaller values find more divergences, larger values find only major ones (1–300)
DTB Strength20Tolerance for double top/bottom matching — higher values allow more swing points to classify as equal highs or lows
Gann SettingsIgnore Inside Bars + Use BreakoutsOnly 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.

FilterWhat It Does
OffNo zone restriction — divergences detected anywhere
Above OverboughtOnly detect divergences when oscillator is above the OB threshold
Below OversoldOnly detect divergences when oscillator is below the OS threshold
Between ThresholdsOnly detect divergences when oscillator is between OB and OS

Point Matching

Point Matching controls which part of the divergence must meet the Value Condition:

OptionWhat It Means
Only StartThe first swing point must be in the restricted zone
Only EndThe second (current) swing point must be in the restricted zone
BothBoth swing points must be in the restricted zone
Reducing False Divergences

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

SettingDefaultWhat It Controls
Show on Main ChartOnDraws divergence lines on the price chart overlay in addition to the oscillator pane
Line StyleDottedStyle for divergence connecting lines (Solid, Dotted, Dashed)
Line Width3Thickness of divergence lines
Text Offset20Distance 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:

AlertDefaultWhat It Fires On
Confirmed BullishOnBar-close-validated bullish divergence (regular or hidden)
Confirmed BearishOnBar-close-validated bearish divergence (regular or hidden)
Bullish (early)OffIntrabar bullish divergence before bar close
Bearish (early)OffIntrabar 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.

Next Steps