MACD divergency
- Indicators
- Version: 2.20
- Updated: 31 July 2026
MACD Divergency is a free MACD divergence indicator for MetaTrader 5 that finds bullish and bearish divergences between price and MACD, marks them with arrows and lines on the chart and in the MACD window, and alerts you by popup, sound, email or push notification. Works on Forex, gold (XAUUSD), indices and crypto, on every timeframe. The divergences do not repaint: once confirmed, the arrow stays.
Bonus: when you get one of my indicators, you also receive a free one-week version of any of my other indicators, so you can test how they work and see whether they fit the trading system you want to build.
Features
The indicator includes these elements:
- Histogram with four colors to show MACD direction and position relative to zero line.
- Detection of regular bullish/bearish and hidden bullish/bearish divergences.
- Lines connecting price pivots to MACD pivots (solid for regular, dashed for hidden).
- Arrows on price chart at divergence points.
- Labels indicating divergence type.
- Dashboard displaying MACD value, signal line, histogram color, and trend direction.
- Alerts via popup, sound, email, or push notification.
The indicator works on any symbol and timeframe. It requires no DLLs and cleans up objects on removal.
How It Works
The indicator computes MACD as the difference between fast and slow EMAs, with a signal line as SMA of MACD. It identifies MACD pivots by checking bars on each side. Divergences form when price and MACD pivots disagree:
- Regular bullish: price lower low, MACD higher low.
- Regular bearish: price higher high, MACD lower high.
- Hidden bullish: price higher low, MACD lower low.
- Hidden bearish: price lower high, MACD higher high.
- Early Warning for Possible Divergence feature!
Input Parameters
MACD Settings
Fast EMA Period: 12
Slow EMA Period: 26
Signal SMA Period: 9
Applied Price: Close price
Divergence Detection
Pivot Strength (bars each side): 5
Max Lookback Bars: 500
Show Regular Divergence: true
Show Hidden Divergence: true
Visual Style
Color for Bull Regular Divergence
Color for Bear Regular Divergence
Color for Bull Hidden Divergence
Color for Bear Hidden Divergence
Divergence Line Width: 1
Show Arrows: true
Show Labels: true
Show Dashboard: true
Alerts
Popup Alert: false
Sound Alert: false
Email Alert: false
Push Notification: false
Usage Notes
Adjust pivot strength for timeframe: lower values (2-3) for M1-M15, 4-5 for M30-H1, 5-8 for H4-Daily. Use on visual charts in Strategy Tester for demo. Alerts trigger once per signal.


Great, useful and free. Thank you