Indicator for detecting MACD divergence (Titan_MACD_Divergence)

Overview of the Indicator
What is MACD Divergence?
MACD (Moving Average Convergence Divergence) is a popular indicator used to visually grasp the strength, direction, and momentum changes of a trend.
There are several analytical methods using MACD, and one of them is divergence.
"Divergence" refers to a situation where the price movement and the MACD movement are going in opposite directions. When divergence occurs, it suggests that market momentum is weakening and there may be a potential trend reversal.
Divergences are generally categorized into the following two types:
① Bullish Divergence:
The price forms a lower low, but MACD forms a higher low
→ Indicates weakening selling pressure and a possible upward reversal
② Bearish Divergence:
The price forms a higher high, but MACD forms a lower high
→ Indicates weakening buying pressure and a possible downward reversal
Divergence is one of the phenomena that many traders pay attention to as a signal for predicting the end of a trend.
Displaying Divergence with Lines
This indicator focuses on the MACD values and price (closing price), and when divergence is detected, it draws a line and notifies the user.
It automatically detects divergence, allowing you to quickly check for potential trend reversals.
[Example of Divergence]

*This indicator is only compatible with the Windows versions of MT5 and MT4 provided by TitanFX.
Indicator Terms of Use
Only those who agree to all the following items may use the indicators distributed on this website (https://research.titanfx.com):
1.The indicators and related descriptions are based on various data believed to be reliable, but their accuracy and completeness are not guaranteed.
2.The data displayed by the indicators do not guarantee your investment results. Also, the displayed content may vary due to market conditions and communication environments.
3.Please make investment decisions using indicators at your own risk. We are not responsible for any disadvantages or damages arising from the use of indicators.
4.Specifications of the indicators are subject to change without notice. Changes will be announced on the indicator description pages, etc.
5.Indicators should only be used by customers who have downloaded them. Transferring or selling the indicators to third parties is prohibited.
Indicator Settings
Input tab (for MT5) or Parameters tab (for MT4)
| Variable Name | Description | Default |
|---|---|---|
| Short Period | Specifies the short EMA period used to calculate MACD. | 12 |
| Long Period | Specifies the long EMA period used to calculate MACD. | 26 |
| Signal Period | Specifies the moving average period for calculating the MACD signal. | 9 |
| Bullish Color | Specifies the color used when bullish divergence occurs. | Aqua |
| Bearish Color | Specifies the color used when bearish divergence occurs. | Magenta |
| Alert (true:ON, false:OFF) | Specifies whether to issue an alert. Select true for alerts, or false for no alerts. | true |
Color tab (for MT5) or Color Settings tab (for MT4)
| MT5 Variable Name | MT4 Variable Name | Description |
|---|---|---|
| MACD | 0 | Specifies the color and thickness of the MACD graph. |
| Signal | 1 | Specifies the color and thickness of the signal line. |