Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
He describes his scan as semi automatic because it detects the first high/low of the MACD - H , the crossover through the zero line and the beginning of the third a final MACD-H value
Simple divergence scans can be created by selecting (somewhat arbitrarily) a time duration (5 days for example) and seeing if prices have increased by more than a given percentage while the associated indicator has decreased by a different given percentage. Here's a sample scan that uses that technique:
[type = stock] and [close > 1.0] and [volume > 40000] and [close > 5 days ago close * 1.025] and [[[macd line(12,26,9) - 5 days ago macd line(12,26,9)] / AbsVal(5 days ago macd line(12,26,9))] < -0.08 ]
In this example, the price must have increased by at least 2.5% over the past five days, while the MACD value must have decreased by at least 8%. (Note: The advanced scan interface must be used because a function of a function (i.e., AbsVal of the MACD) is needed.)
While this technique is easy to program into a scan engine, its results are hit-and-miss. Many of the charts returned by this kind of scan are not really experiencing a negative divergence. A visual review of all stocks returned by this kind of scan is a necessity.
The only TOS divergence indicator I know of that has divergence is the Knoxville divergence which can be found in the elite download section here if you do a search. I don't know if you will find much use for it though as doesn't draw rays it draws arrows because TOS cant be coded to draw rays as far as I have seen.
plot cond = volume > 40000 and close > (close[5] * 1.025) and (MACD(12, 26, 9).value - MACD(12, 26, 9).value[5]) / AbsValue(MACD(12, 26, 9).value[5]) < -0.08;
growex: That scan works exactly as specified - the problem is that the specification requires to compare MACD and price on specific bars which is in itself useless - but your code works great.
Question: Can you create code to identify peaks and troughs and make comparisons with respect to them?
This web site is selling the indicators you are looking for, a bit pricy but perhaps someone can look at the description and code it themselves. I have some RSI and MACD divergence code if it can help?