Five oscillators watching for the same lie: Flat Divergence Detector for MT5
Divergence is the moment price and momentum stop telling the same story. Price pushes to a new high, but the oscillator refuses to follow — or price holds its trend while the oscillator prints the opposite extreme. That disagreement is where reversals often begin and continuations often confirm themselves. Flat Divergence Detector for MT5 watches for that moment on a single MetaTrader 5 chart, across five oscillators — RSI, Stochastic, CCI, MFI and MACD — and draws it where it happens: a line connecting the two pivots on the price chart, an arrow, and a label naming the oscillator and the type.
Each oscillator has its own ON/OFF switch, and detection runs independently per oscillator, so several can confirm the same pivot pair at once. RSI, Stochastic, CCI and MFI are ON by default; MACD is OFF by default and is simply one of the five.
Regular vs hidden divergence
Both kinds are detected, in both directions:
- Regular divergence (bullish and bearish): price makes a new extreme while the oscillator does not — momentum fading, a possible reversal.
- Hidden divergence (bullish and bearish): price holds its trend structure while the oscillator makes the opposite extreme — a possible continuation.
Regular divergence is drawn with a solid line, hidden with a dashed line.
Closed bars only, no repaint
A pivot (swing high / swing low) is used only after it is confirmed by the required number of bars on its right side, and only closed bars enter the calculation. Once a signal is drawn it never moves and never disappears.
The honest trade-off of that design: because the pivot must be confirmed first, a signal appears on the confirmation bar, a fixed number of bars after the pivot itself. The line and arrow are drawn at the pivots, but the buffer value and the alert fire on the confirmation bar. Divergence is a suggestion, not a guarantee — in a strong trend, regular divergence can appear repeatedly and still be run over.
Buffers for external tools
The indicator exposes 8 buffers. Buffers 4 (Buy) and 5 (Sell) are edge-type signals — 1.0 on the signal bar only, read at shift 1 — for external tools such as Flat Manual Trader MT5 via iCustom (set Buy = 4, Sell = 5, shift = 1). The source of buffers 4 and 5 can be selected: regular only (default), hidden only, or both. The indicator itself does not place orders.
Panel and alerts
The movable panel lists each oscillator with its ON/OFF state, its current value, and its most recent signal (type, direction, how many bars ago), plus the last confirmed pivot high and low with price and time. Drag it anywhere; it stays in front of the chart drawings and its position is saved.
Alerts fire only when a signal is confirmed, and only for the newest bar: pop-up, push notification, e-mail and sound, each switchable, and the same divergence never alerts twice.
Try it free in the Strategy Tester
You can try the indicator free of charge in the MetaTrader 5 Strategy Tester before buying. The product page is here: Flat Divergence Detector MT5 — price $59.
Disclaimer: This product is a trading support tool. It does not provide investment advice and does not guarantee profit. Trading involves risk; please test on a demo account first and trade at your own responsibility.


