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.
How to screen for MACD histogram negative then positive
Moderator: Chris White
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: How to screen for MACD histogram negative then positive
Try the following script:
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:
Code: Select all
WMACD: FML('MACD(12,26,9)[HIST]#WEEK1');
Cond1: CROSS(WMACD, 0);
Event: BARSSINCE(Cond1) < 15;
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: