mgibson91

MG - MACD - Divergence - 1.0

The MACD indicator can produce some powerful divergence signals which can be useful confirmation for entering / exiting a trade.

This indicator generates and alert and plots (if enabled), when a divergence is detected. For example, if bullish (above zero) and two bearish MACD crosses are detected with the second being lower than the first, a bearish divergence alert is triggered. Theoretically a good place to take profit / possibly enter a short position if you have further confirmation.

Can also be configured to include continuation signals i.e. a bullish trend with two bullish MACD crosses where the second is higher than the first. This could indicate more bullish action ahead.


In order to illustrate how this indicator helps to sift out a good amount of false signals, I have highlighted in the above image in dark green, all of the divergence buy signals highlighted by the indicator and in light green, the rest of the MACD buy signals.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?