PROTECTED SOURCE SCRIPT
Moving Average Convergence Divergence Pro

This script is an advanced and highly customizable version of the classic Moving Average Convergence Divergence (MACD) indicator for TradingView. It builds upon the standard MACD by adding professional features like divergence detection, visual enhancements, configurable alerts, and optional smoothing, making it a more powerful tool for technical analysis.
Key Features and Functionality
Enhanced Visual Customization:
Toggleable Elements: You can independently show or hide the main MACD line, signal line, histogram, and the fill area between the lines.
Customizable Colors: All elements (bullish, bearish, signal line, divergence markers) can be colored to your preference.
Dynamic Histogram: The histogram uses a gradient effect, becoming more transparent during weaker momentum and more opaque during stronger momentum.
Optional EMA Smoothing:
Includes an option to apply an Exponential Moving Average (EMA) to the main MACD line, which can help smooth out noise and provide clearer signals.
Built-in Divergence Detection:
Automatically scans for classic bullish and bearish divergences between price and the MACD line.
Bullish Divergence: Price makes a lower low, but the MACD line makes a higher low (and is above the zero line).
Bearish Divergence: Price makes a higher high, but the MACD line makes a lower high (and is below the zero line).
These are clearly marked with triangle shapes at the top and bottom of the indicator panel.
Comprehensive Alert Conditions:
The script is pre-configured to generate alert conditions for:
Bullish Crossover (MACD line crosses above Signal line)
Bearish Crossunder (MACD line crosses below Signal line)
Bullish Divergence Detection
Bearish Divergence Detection
This allows traders to set up automated notifications directly within TradingView.
Clear Visual Cues:
The entire indicator's background changes color to signal key events:
Green for a bullish crossover.
Red for a bearish crossunder.
Light Green for a bullish divergence.
Light Red for a bearish divergence.
How to Use the Indicator
Signal Generation:
Crossover: The most common signal. A buy signal occurs when the MACD line crosses above the signal line (especially near or below the zero line). A sell signal occurs when it crosses below.
Zero Line: The MACD line crossing above the zero line is considered bullish, and crossing below is bearish.
Divergence: Divergences can be powerful signals for potential trend reversals. A bullish divergence suggests selling pressure may be exhausting, while a bearish divergence suggests buying pressure may be waning.
Customization for Your Strategy:
If you find the standard MACD too noisy, enable the "Show EMA of MACD" option to smooth the main line.
If you only care about crossovers, you can turn off the histogram and fill to reduce visual clutter.
Use the divergence detection to spot high-probability reversal setups that other traders might miss.
Key Features and Functionality
Enhanced Visual Customization:
Toggleable Elements: You can independently show or hide the main MACD line, signal line, histogram, and the fill area between the lines.
Customizable Colors: All elements (bullish, bearish, signal line, divergence markers) can be colored to your preference.
Dynamic Histogram: The histogram uses a gradient effect, becoming more transparent during weaker momentum and more opaque during stronger momentum.
Optional EMA Smoothing:
Includes an option to apply an Exponential Moving Average (EMA) to the main MACD line, which can help smooth out noise and provide clearer signals.
Built-in Divergence Detection:
Automatically scans for classic bullish and bearish divergences between price and the MACD line.
Bullish Divergence: Price makes a lower low, but the MACD line makes a higher low (and is above the zero line).
Bearish Divergence: Price makes a higher high, but the MACD line makes a lower high (and is below the zero line).
These are clearly marked with triangle shapes at the top and bottom of the indicator panel.
Comprehensive Alert Conditions:
The script is pre-configured to generate alert conditions for:
Bullish Crossover (MACD line crosses above Signal line)
Bearish Crossunder (MACD line crosses below Signal line)
Bullish Divergence Detection
Bearish Divergence Detection
This allows traders to set up automated notifications directly within TradingView.
Clear Visual Cues:
The entire indicator's background changes color to signal key events:
Green for a bullish crossover.
Red for a bearish crossunder.
Light Green for a bullish divergence.
Light Red for a bearish divergence.
How to Use the Indicator
Signal Generation:
Crossover: The most common signal. A buy signal occurs when the MACD line crosses above the signal line (especially near or below the zero line). A sell signal occurs when it crosses below.
Zero Line: The MACD line crossing above the zero line is considered bullish, and crossing below is bearish.
Divergence: Divergences can be powerful signals for potential trend reversals. A bullish divergence suggests selling pressure may be exhausting, while a bearish divergence suggests buying pressure may be waning.
Customization for Your Strategy:
If you find the standard MACD too noisy, enable the "Show EMA of MACD" option to smooth the main line.
If you only care about crossovers, you can turn off the histogram and fill to reduce visual clutter.
Use the divergence detection to spot high-probability reversal setups that other traders might miss.
Script protégé
Ce script est publié en source fermée. Toutefois, vous pouvez l'utiliser librement et sans aucune restriction - en savoir plus ici.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script protégé
Ce script est publié en source fermée. Toutefois, vous pouvez l'utiliser librement et sans aucune restriction - en savoir plus ici.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.