Divergence IndicatorProX
- Göstergeler
- Sürüm: 1.0
- Etkinleştirmeler: 5
Divergence Indicator Pro X
Divergence Indicator Pro X is a professional divergence indicator for MetaTrader 4 that automatically detects divergences between price and oscillator right on the chart.
Full MT5-version functionality, adapted for MQL4. Works on any instrument and timeframe, no repaint.
🎯 What the indicator shows
1. Regular Divergence — classic reversal signal:
-
🟢 Bullish regular — price makes Lower Low, oscillator — Higher Low. Possible reversal up.
-
🔴 Bearish regular — price makes Higher High, oscillator — Lower High. Possible reversal down.
2. Hidden Divergence — trend continuation signal:
-
🟢 Bullish hidden — price makes Higher Low, oscillator — Lower Low. Uptrend continues.
-
🔴 Bearish hidden — price makes Lower High, oscillator — Higher High. Downtrend continues.
Lines connect price pivots, arrows mark the signal direction. Regular uses solid line, hidden uses dashed.
📊 Supported Oscillators
One parameter — four oscillators:
| Oscillator | Settings |
|---|---|
| RSI | Period (14 default) |
| MACD | Fast (12), Slow (26), Signal (9) |
| Stochastic | %K (5), %D (3), Slowing (3) |
| CCI | Period (14) |
Switching — one input field.
✨ Key features
🔍 Automatic Pivot Detection
Scans last N bars (300 by default) and finds local price highs/lows with configurable confirmation window (5 bars left/right by default).
📐 Four Divergence Types
Regular + Hidden, both directions. Each type can be disabled separately.
🎨 Chart Visualization
-
Colored lines between pivots
-
Arrows at signal points
-
Solid for regular, dotted for hidden
-
Configurable colors, widths, arrow sizes, price offset
🔔 Smart Alerts
-
Push notifications to phone
-
Sound alert
-
Journal logging
-
60-min cooldown — anti-spam protection
⚡ New-bar processing
Recalculates layout only on new bar formation. Guarantees stability after bar close.
🛠 Installation — MetaTrader 4
-
Copy DivergenceIndicatorPro.mq4 to MQL4/Indicators/ folder
-
Open MetaEditor (F4), compile (F7) — must be 0 errors, 0 warnings
-
Restart MT4 or refresh Navigator
-
Drag onto chart: Insert → Indicators → Custom → DivergenceIndicatorPro
-
Configure oscillator, pivot window, and alerts
Typical file path:
C:\Users\{User}\AppData\Roaming\MetaQuotes\Terminal\{ID}\MQL4\Indicators\
📌 Recommended Settings
| Instrument | Timeframe | Oscillator | Pivot Lookback | Scan Bars |
|---|---|---|---|---|
| EURUSD, GBPUSD | H1 | RSI(14) | 5 | 300 |
| XAUUSD | H4 | MACD(12,26,9) | 5 | 200 |
| BTCUSD | H4 | RSI(14) | 5 | 200 |
| US500 | M15 | Stochastic(5,3,3) | 3 | 500 |
Timeframes:
-
M5–M15 — scalping (Pivot Lookback = 3)
-
H1–H4 — swing trading (Pivot Lookback = 5)
-
D1 — medium-term (Pivot Lookback = 8)
📌 Trading scenarios
1. Reversal trading (regular divergence)
-
Bullish regular + confirmation → BUY
-
Bearish regular + confirmation → SELL
2. Trend continuation (hidden divergence)
-
Bullish hidden on pullback in uptrend → BUY
-
Bearish hidden on pullback in downtrend → SELL
3. Combined with levels
-
Divergence near Pivot Point / Daily Range — stronger signal
-
Divergence on strong support/resistance — higher probability
4. Multi-timeframe
-
H4 + confirmation on H1 — entry
-
H1 without higher TF confirmation — observe only
⚙️ Parameters
| Parameter | Description | Default |
|---|---|---|
| InpOscillator | Oscillator type (0=RSI, 1=MACD, 2=Stoch, 3=CCI) | 0 (RSI) |
| InpRSIPeriod | RSI period | 14 |
| InpMACDFast / Slow / Signal | MACD parameters | 12 / 26 / 9 |
| InpStochK / D / Slowing | Stochastic parameters | 5 / 3 / 3 |
| InpCCIPeriod | CCI period | 14 |
| InpPivotLookback | Bars left/right to confirm pivot | 5 |
| InpScanBars | How many last bars to scan | 300 |
| InpMaxPivots | Max pivots to compare | 5 |
| InpShowRegular | Show regular divergences | true |
| InpShowHidden | Show hidden divergences | true |
| InpShowLines | Draw lines | true |
| InpShowArrows | Draw arrows | true |
| InpBullColor / BearColor | Bullish/bearish colors | Lime / Red |
| InpLineWidth | Line width | 2 |
| InpArrowSize | Arrow size | 3 |
| InpArrowOffsetPts | Arrow offset from price (points) | 50 |
| InpAlert | Enable alerts | true |
| InpAlertPush | Push notifications | true |
| InpAlertSound | Sound alert | true |
| InpAlertCooldownMin | Cooldown between alerts (min) | 60 |
| InpSoundFile | Sound file name | alert.wav |
| InpVerboseLog | Detailed journal log | true |
📋 Implementation notes (MT4)
-
Pure MQL4 — no DLLs, no external dependencies
-
Uses standard functions iRSI , iMACD , iStochastic , iCCI
-
No repaint — signals stable after bar close
-
Works on any instrument: Forex, metals, indices, CFD
-
All timeframes: M1 — MN1
-
Correct MT4 indexing (0 = newest bar)
-
Broker StopLevel handling
-
Operation logging to terminal journal
-
Compatibility: build 600+
⚠️ Important warning
Divergence Indicator Pro X is an analysis tool, not a trading system. The indicator shows divergences between price and oscillator, but does not generate ready-made entry signals. All trading decisions are made by the trader.
Using the indicator does not guarantee profit. Test on a demo account before live trading.
🏆 About the developer
Musa Khunarikov — trader with 12 years of live experience (Forex, stocks, MOEX, metals). 51 certifications from "Finam" training center in trading, algo trading, and MetaTrader.
Live trading:
👉 https://developer-mql4-mql5.netlify.app/
Services: EA development, indicators, panels, trading system audit.
📞 Support
30 days of free support after purchase. Bug fixes within 48 hours.
