Page 1 of 1

How to screen for MACD histogram negative then positive

Posted: Mon Apr 09, 2012 3:12 pm
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.

Re: How to screen for MACD histogram negative then positive

Posted: Mon Apr 09, 2012 3:48 pm
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 16637 times