I want to code MACD Histogram divergence like Dr. Alexander Elder in his book(Two Roads Diverged: Trading Divergences).
Here’s the definition of a bullish divergence: “It occurs when prices trace a bottom, rally, and then sink to a new low. At the same time, MACD-Histogram traces a different pattern. When it rallies from its first bottom, that rally lifts it above the zero line, ‘breaking the back of the bear.’ When prices sink to a new low, MACD-Histogram declines to a shallower bottom. At that point, prices are lower, but the bottom of MACD-Histogram is higher, showing that bears are weaker and the downtrend is ready for a reversal. MACD-Histogram gives a buy signal when it ticks up from its second bottom”.
and Bearish divergences: “It occur near market tops, where they identify dangerous cracks in seemingly happy uptrends. A bearish divergence occurs when prices rise to a new high, decline, then rise to a higher peak. MACD-Histogram gives the first sign of trouble when it breaks below its zero line during the decline from its first peak. When prices reach a higher high, MACD-Histogram rises to a much lower high. It shows that bulls are weaker, prices are rising simply out of inertia and are ready to reverse.”