about MACD Histogram divergence

Optuma Forums Optuma Scripting about MACD Histogram divergence

This topic contains 1 reply, has 2 voices, and was last updated by Darren Darren 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45495

    Ho
    • Topics: 1
    • Replies: 0
    • Posts: 1

    Hi. 

    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.”

    Thank you!

    Attachments:
    #45543
    Darren
    Darren
    • Topics: 20
    • Replies: 83
    • Posts: 103

    Thanks Ho. See this post on divergences based on RSI:

    https://forum.optuma.com/topic/how-to-calculate-positive-and-negative-divergences/

    You would need to change the RSI to MACD Histogram to calculate the pivot lows:

    M1 = MACD(BAR1=12, BAR2=26, OSC=9).Histogram;
    P1 = PIVOT(M1, MIN=7, TYPE=Low);
    V1 = VALUEWHEN(M1, P1 <> 0);
    Sig1 = V1 > V1[1];
    V2 = VALUEWHEN(Close(),
    P1 <> 0);
    Sig2 = V2 < V2[1];
    M1 < 0 and Sig1 and Sig2

    • This reply was modified 1 month ago by  Mark.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Pin It on Pinterest

Share This

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close