RE: MACD Divergences
Here's a scan that I use which looks for Bullish Divergences. The scan looks for a lower stock price over the last ten days compared to the previous 50 days, then looks for a higher MACD (line and histogram) over the same period.
Change the ">" to "<" and vice versa, "daily min" to "daily max" and "daily low" to "daily high" to scan for Bearish Divergences.
You can also change daily to whatever time period you want to scan for, and the 10 and 50 to any number of periods you want to look at.
You can omit either the line or histogram portion of the MACD scan if you don't want both. Personally, I think the divergence is more meaningful if you've got both.
The scan can probably be modified to look for volume divergences as well, although I've never tried it.
[daily min(10,daily low) < 10 days ago daily min(50,daily low)] and [daily min(10,daily macd hist(12,26,9)) > 10 days ago daily min(50,macd hist(12,26,9))] and [daily min(10,MACD Line (12,26,9)) > 10 days ago daily min(50,MACD Line (12,26,9))]
Copy and paste the above code into the advance scan builder, along with any filters you want to add. Hope this helps.
Another approach would be to use the slope function. The following scan just returned 54 symbols. Reverse the "<' and ">' to scan for the opposite divergence.
[type = stock] and [country = us] and
[daily sma(20,daily volume) > 200000] and
[daily sma(60,daily close) > 10] and
// slope of the MACD signal positive
[daily slope(20,daily macd signal(12,26,9)) > 0] and
// slope of the price negative
[daily slope(20,daily close) < 0]
Here is a solution for bullish divergences between price and the MACD Histogram.
I originally included the "Lower Lows / Higher Lows" part of the code, but now I have that switched off (with the // sign in front), and instead prefer a semi-automatic approach. Feel free to switch it back on and experiment.
The configuration below will output stocks that are in the first uptick within a trough in the MACD histogram. It can also be tuned to output only significant divergences. That's the automatic part.
The manual part is to look at the charts of each result and see if the current trough is part of a divergence or not. The fastest way to do this is to copy and paste the list of output stocks into the Candle Glance feature, and select MACD as the indicator (only one is allowed in Candle Glance). You can see the good ones in seconds this way.
This semi-automatic approach will give you a handful of tradeable divergences every day, with only a few seconds of work. (This is the reverse of Elder's semi-automatic approach, which involves automatically finding the 1st trough and manually looking for the 2nd)
[type = stock] AND [Daily SMA(20,Daily Volume) > 500000] and [close > 2]
// Looks for Lower Lows in price (This needs tweaking still)
//AND [min(20,close) <= min(60, close)]
//AND [EMA(10) < EMA(65)]
// Looks for HIGHER lows in MACD HIST (This also needs tweaking)
// AND [min(20,macd hist(12,26,9)) > min(60,macd hist(12,26,9))]
// Looks for MACDH bottoming and uptick in DAILY bars
AND [macd line(12,26,9) < 0]
AND [macd hist(12,26,9) < 0]
AND [macd hist(12,26,9) > yesterday's macd hist(12,26,9)]
AND [yesterday's macd hist(12,26,9) < 2 days ago macd hist(12,26,9)]
// Looks for a more significant divergence. Tweak the parameters to filter more or less.
AND [yesterday's macd hist(12,26,9) > 0.6 * min(40, macd hist(12,26,9))]
answered Nov 07 '13 at 02:24