AlgoSpecial_DivergenceRadar — The Complete Technical Guide to Multi-Oscillator Divergence on MT5
Trial: valid until 05 January 2027 · Full version: $80 — algospecial.com or t.me/bullionstrategy
Keywords: divergence indicator MT5, RSI divergence indicator, MACD divergence indicator, multi oscillator divergence, regular divergence, hidden divergence, divergence scanner MT5, bullish divergence indicator, hidden divergence EA filter.

Divergence is a story about disagreement
Divergence is the moment price and momentum stop telling the same story. Price makes a higher high, but the oscillator makes a lower high — buyers are still pushing, but with less force. Or price makes a lower low, but the oscillator makes a higher low — sellers are exhausted. That disagreement is one of the oldest and most powerful ideas in technical analysis, and it is also one of the most abused, because a single oscillator produces far too many false divergences to trade blindly.
AlgoSpecial_DivergenceRadar attacks that weakness head-on. Instead of one study, it evaluates ten oscillators simultaneously, confirms divergence only at genuine pivots, and prints a coloured box that tells you exactly how many and which oscillators agree. When one oscillator disagrees with price, it is noise. When eight agree, it is a statement.
This guide explains the theory of divergence, the mathematics of each of the ten engines, the exact detection and confirmation logic, every input, how to read the confluence box, and how to fold divergence into a rules-based system.
1. Regular vs hidden divergence — and why both matter
Regular (classic) divergence signals potential reversal:
- Bullish regular: price makes a lower low, oscillator makes a higher low → downside momentum fading.
- Bearish regular: price makes a higher high, oscillator makes a lower high → upside momentum fading.
Hidden (or "reverse") divergence signals continuation:
- Bullish hidden: price makes a higher low, oscillator makes a lower low → the pullback was shallow while momentum reset — a continuation setup in an uptrend.
- Bearish hidden: price makes a lower high, oscillator makes a higher high → a weak bounce inside a downtrend.
Most tools detect only regular divergence and therefore miss the continuation setups that trend traders actually want. DivergenceRadar detects both and lets you choose which to display — a crucial distinction that turns it from a reversal-only tool into a complete momentum framework.
2. Why ten oscillators instead of one
Each oscillator measures a different facet of momentum, and each has blind spots:
- MACD — the difference between two EMAs; trend and momentum.
- MACD histogram — the spread between MACD and its signal line; momentum acceleration.
- RSI — bounded 0–100 momentum; classic overbought/oversold context.
- Stochastic — where price closes within its recent range; short-term pressure.
- CCI — deviation from a typical-price mean; cyclical extremes.
- Momentum — raw rate of change.
- OBV — cumulative volume with a sign per bar; volume-confirmed pressure.
- VWMACD — MACD weighted by volume; filters out low-conviction moves.
- Chaikin Money Flow (CMF) — accumulation/distribution over a window.
- Money Flow Index (MFI) — volume-weighted RSI; the "volume RSI."
A divergence that appears on RSI alone can be meaningless. The same divergence echoed by MACD, Stochastic, CMF and MFI — four independent computations of momentum — is a very different signal. DivergenceRadar computes all ten internally, so it does not depend on the terminal's built-in indicator versions; the maths is self-contained and reproducible.
Because forex and CFDs have no centralised volume, the volume-based oscillators (OBV, VWMACD, CMF, MFI) use tick volume — the number of price updates — which is the standard, honest proxy available on retail feeds.
3. Inside the engine: how DivergenceRadar works
The indicator is pure MQL5 with no DLLs and no WebRequest. Its pipeline is:
- Pivot detection. For each oscillator it finds confirmed pivots using `Span` bars on each side, on either close or wick prices (`PivotSource`). A pivot is only confirmed once the surrounding bars have closed.
- Divergence search. From each new pivot it looks back up to `MaxReach` bars and up to `MaxPivots` prior pivots, comparing the oscillator's direction against price's direction at those pivots, and requiring the "clear path" condition (no intervening pivot that would invalidate the comparison).
- Agreement tally. A candidate signal on the current bar is accepted only if at least `MinCount` oscillators agree.
- Confirmation. With `Confirm` on (default), the signal waits for the next bar to close, guaranteeing the past never changes.
- Rendering. A divergence line is drawn on price, and a coloured box labels the signal bar with the oscillator cluster and its count. `LastOnly` keeps just the most recent signal if you prefer a minimal chart.
The result is a scanner that is quiet when momentum is undecided and loud only when the majority of independent engines agree — the definition of a high-confluence signal.
4. Every input parameter, explained
Pivots
- Span — default 5. Bars on each side required to confirm a pivot. Higher = fewer, stronger pivots.
- Pivot source — default PIVOT_CLOSE; switch to wicks to catch spike extremes.
Divergence
- Divergence type — default KINDS_REGULAR; choose regular, hidden, or both.
- Minimum divergences on a bar — default 1. The agreement threshold; raise to 3–5 for high-confluence-only signals.
- Pivots checked back — default 10.
- Bars checked back — default 100.
- Wait for the next bar to confirm — default true. The anti-repaint guarantee.
- Keep only the latest divergence — default false.
- Bars scanned on load — default 2000.
Display
- Oscillator names — default full names; can show first-letter or none.
- Show the divergence count — default true.
- Draw divergence lines / mark pivot points / show SMA 50 & 200 — display toggles.
Oscillators
- Ten independent on/off switches (MACD, histogram, RSI, Stochastic, CCI, Momentum, OBV, VWMACD, CMF, MFI). Turn off the ones you do not trust to raise the bar for the remaining ones.
Colors
- Bullish/Bearish regular — default AlgoSpecial green `16,185,129` / red `239,68,68`.
- Bullish/Bearish hidden — default cyan `0,210,255` / amber `245,158,11`.
- Box text colors for readability.
Alerts
- Bullish / bearish divergence alert — off by default; popup, sound, email or push.
- Also send a push notification — toggle.
Extras
- Print License Information in the Experts Log on Start — default true.
5. Reading the confluence box
In the screenshot above, divergence signals appear as lines on price with a coloured box at the signal bar. The box is the key: it lists which oscillators agreed and the count. A box reading "8" is a different animal from one reading "1." Practical rules:
- Trust the count. Require a high count (say 4+) for standalone entries; treat low counts as watch-list alerts only.
- Separate regular from hidden by colour. Green/red = potential reversal; cyan/amber = continuation.
- Location matters. Divergence at a key level (LevelHunterPro) or after a liquidity sweep (SessionBoxer) is far stronger than divergence in the middle of nowhere.
- Confirm with price action. Wait for a structure break (a swing high/low taken out) after the divergence before committing.
6. The playbook
- Reversal at extremes. Bearish regular divergence at PDH or a round number → look for a short on the first lower high.
- Continuation in trend. Bullish hidden divergence during a pullback in an uptrend → add or enter in the trend direction.
- Confluence stack. Divergence + fair value gap (ImbalanceZoneX) + level = a three-reason entry.
- EA filter. The minimum-count rule makes DivergenceRadar an excellent momentum filter for an Expert Advisor that wants "no reversal risk" confirmation before adding to a position.
7. Instruments and timeframes
DivergenceRadar is symbol-agnostic and works on forex (EURUSD, GBPUSD, USDJPY, GBPJPY), gold (XAUUSD — where it is especially effective, as the chart screenshot shows), indices (US100, US30, GER40) and crypto. Use higher spans and counts on lower timeframes to control noise; M15–H4 is the sweet spot for intraday, H4–D1 for swing.
8. Risk and prop-firm notes
Divergence is a context tool, not a stop-loss substitute. Always pair it with a defined invalidation level and a fixed per-trade risk. For prop firms, the minimum-count filter is valuable because it reduces the number of marginal trades that erode a daily loss budget.
9. Installation
- Copy `AlgoSpecial_DivergenceRadar.ex5` into `MQL5\Indicators\`.
- Refresh the Navigator and attach to a chart.
- Load `AlgoSpecial_DivergenceRadar.set` from the Inputs tab.
- Tune the minimum divergence count and pivot span to your timeframe.
10. Download
The compiled EX5 and ready SET are free, with a trial valid until 05 January 2027. Full version $80 — algospecial.com or t.me/bullionstrategy.
11. Advanced: the mathematics behind each of the ten engines
Understanding what each oscillator actually computes explains why multi-oscillator agreement is so powerful — the ten engines measure genuinely different things, so agreement is independent evidence.
- MACD = EMA(fast) − EMA(slow); a measure of trend momentum.
- MACD histogram = MACD − signal(MACD); momentum acceleration — it turns before MACD itself.
- RSI = 100 − 100/(1+RS), where RS is average gain / average loss over the period; a bounded momentum gauge.
- Stochastic %K = 100 × (close − lowest low) / (highest high − lowest low); where price sits in its recent range.
- CCI = (typical price − SMA) / (0.015 × mean deviation); a mean-deviation oscillator that ignores bounds.
- Momentum = close − close[n]; the rawest rate of change.
- OBV = cumulative sum of ±volume; volume-confirmed directional pressure.
- VWMACD = a MACD computed on volume-weighted prices; it discounts bars with thin participation.
- CMF = Σ[(close − low) − (high − close)] / (high − low) × volume over n, divided by Σvolume; accumulation/distribution.
- MFI = volume-weighted RSI; money-flow momentum.
When price makes a higher high and all ten make a lower high, every independent definition of momentum agrees that the move is losing force. That is the statistical heart of DivergenceRadar, and it is why the minimum-count filter is the single most important input.
12. The confirmation logic in depth
The `Confirm` option deserves special attention because it is what makes the tool trustworthy. Without confirmation, a divergence can be drawn on the current forming bar and then disappear if the oscillator value changes before the bar closes — the classic "repainting divergence" that has burned countless traders. With confirmation on (the default), DivergenceRadar waits until the next bar has closed before finalising the signal. The result is a chart you can trust: a box that appears is a box that stays. The `ClearPath` condition further requires that no intervening pivot invalidates the price/oscillator comparison, removing the false divergences that arise from comparing non-adjacent extremes.
13. Failure modes of divergence (and how the engine handles them)
- Strong trends ignore divergence. In a powerful trend, oscillators can stay overbought/oversold and print divergence after divergence while price keeps going. Fix: use hidden divergence for continuation and require a structure break before acting on regular divergence.
- Too many false positives from one oscillator. Fix: the minimum-count filter.
- Comparing the wrong pivots. Fix: the pivot-span and clear-path logic.
- Repainting. Fix: confirmation on by default.
- Ignoring location. Divergence in the middle of nowhere is weak; divergence at a key level or after a sweep is strong. Fix: combine with LevelHunterPro and SessionBoxer.
14. Parameter tuning matrix
| Timeframe / Style | Span | Min count | Max pivots | Reach | Type |
|---|---|---|---|---|---|
| Scalping (M5–M15) | 3 | 4 | 8 | 60 | Regular |
| Intraday (M15–H1) | 5 | 3 | 10 | 100 | Both |
| Swing (H1–H4) | 5 | 2 | 10 | 150 | Both |
| Position (D1) | 7 | 2 | 8 | 200 | Both |
Higher minimum counts produce fewer, higher-quality signals; lower counts produce more frequent but noisier ones. Match the count to your risk tolerance and to how much confirmation you need.
15. Common mistakes
- Acting on a single-oscillator divergence. Raise the minimum count.
- Confusing regular and hidden. Regular = potential reversal; hidden = continuation. Colour them differently and trade them differently.
- Entering before confirmation. Wait for the confirmation bar and, ideally, a structure break.
- Ignoring the trend. A regular divergence against a strong trend is a low-probability fade.
- Trading divergence without a stop. Divergence is context; the stop still goes beyond the invalidation point.
16. Backtesting and forward-testing notes
To build confidence, replay history and record every divergence box with its count, then classify the outcome over the next N bars: reversal, continuation, or nothing. Sort by count. You will typically find a clear relationship — higher counts correlate with better follow-through — which lets you set your minimum count empirically rather than by guesswork. Because signals are confirmed on closed bars, your historical study matches what you would have traded live.
17. Using DivergenceRadar as an EA filter
The minimum-count rule makes DivergenceRadar a superb external filter for an Expert Advisor. A typical rule: before an EA adds to or opens a trend position, require the absence of opposing regular divergence above a threshold count — this avoids adding into exhausted moves. Because the indicator exposes its findings through its own computation (no external calls), it can be read programmatically or visually with equal confidence. That is the same philosophy behind AlgoSpecial_ChaosNavigatorEA and AlgoSpecial_CompressionSniperEA, which use their own internal engines as decision gates.
18. Quick-reference cheat sheet
- Trust the count: a box reading "8" is a different animal from one reading "1".
- Regular divergence = potential reversal (green/red); hidden divergence = continuation (cyan/amber).
- Keep confirmation on — it is the anti-repaint guarantee.
- Require a minimum count of 3–5 for standalone entries; treat low counts as watch-list alerts.
- Location matters: divergence at a key level or after a sweep is far stronger.
- Wait for a structure break after the divergence before committing.
- In strong trends, prefer hidden divergence and never fade blindly.
- Volume-based oscillators (OBV, VWMACD, CMF, MFI) use tick volume on retail feeds.
- Raise the pivot span on lower timeframes to cut noise.
- Turn off oscillators you do not trust to raise the bar for the rest.
- Use it as an EA filter to avoid adding into exhausted moves.
- Divergence is context, not a stop — the stop still goes beyond the invalidation point.
FAQ
Is AlgoSpecial_DivergenceRadar free? Yes — free `.ex5` + `.set` with a trial until 05 January 2027.
Which oscillators are supported? MACD, MACD histogram, RSI, Stochastic, CCI, Momentum, OBV, VWMACD, CMF and MFI — all computed internally.
What is hidden divergence? A continuation signal: price makes a higher low while the oscillator makes a lower low (bullish hidden), and the mirror for bearish.
Does it repaint? No — with confirmation on, signals are only finalised after the next bar closes.
Can I require multiple oscillators to agree? Yes — set the minimum divergence count.
Which markets work best? Forex, gold, indices and crypto; gold shows particularly clean divergences.
Does it need internet or Python? No — pure MQL5, fully offline.
Can I show only regular or only hidden? Yes — choose the divergence type.
Risk disclaimer: educational trading software, not investment advice. Test on demo first. See algospecial.com for the full disclaimer.
Free Download
The compiled MT5 indicator and the ready preset are free to download. Trial valid until 05 January 2027. The MQL5 source is not included; the full version is $80.