How to screen for MACD histogram negative then positive

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
Import
Posts: 21
Joined: Wed Dec 29, 2010 5:28 pm

How to screen for MACD histogram negative then positive

Post by Import »

Is it possible to screen for the MACD histogram negative and then positive in a weekly chart?

Something like histogram negative some weeks ago and then positive in recent weeks. This way I could get a short list of candidates and then visually view to see if there is a MACD divergence.
Chris White
Posts: 212
Joined: Mon Nov 29, 2010 9:21 pm

Re: How to screen for MACD histogram negative then positive

Post by Chris White »

Try the following script:

Code: Select all

WMACD: FML('MACD(12,26,9)[HIST]#WEEK1');
Cond1: CROSS(WMACD, 0);

Event: BARSSINCE(Cond1) < 15;
Here the weekly MACD histogram is given the name WMACD and then we are looking for a cross above 0. That condition is given the name Cond1.
The event is then generated whenever that cross has been fewer than 15 trading days ago (3 weeks).

Using this scan you can get a list of today's candidates and then visually view the chart to see if there is a MACD divergence. Here's a chart with the daily MACD in one sub area and the scan in another:
Chart showing daily MACD Weekly MACD scan
Chart showing daily MACD Weekly MACD scan
macdscan.png (55.36 KiB) Viewed 16639 times
Post Reply