New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Hi, I am trying to write a scan for MACD divergence with double bottom within recent at least 20 bars, please take a look at the daily chart of BABA as of 12/31/2016. Can someone please help ? thank you.
0
Comments
So you might choose a falling MA 21. To test for a falling MA, compare its value some number of bars ago to its current value. The current value should be less, so:
and [sma(21,close) < 10 days ago sma(21, close)]
You can try a value other than 21 for the MA and a value other than 10 for a look back value to see what works.
To test for a rising MACD Signal, you would do the same test, but the current value should be greater than the look back value, so:
and [MACD Signal (12,26,9) > 10 days ago MACD Signal (12,26,9)]
Getting the double bottom is tricky, because the distance between them varies so much. You could try testing for a Price Channel break. First, you have to test that the channel has been flat for some period of time. Its hard to know how long this flat period should be so you might try testing for a flat period in the middle, rather than end to end - so maybe:
and [ 10 days ago Lower Price Chan(21) = 15 days ago Lower Price Chan(21)]
And then test for a new low over some period of time
and [low = min(21, low)]
You might try min(10, low), instead, or some other number that makes sense to you.
If you run this scan as of 12/22, it picks up BABA.
You might want to try leaving off the last two lines ( or include them in the scan but put "//" in from of each line to prevent them from executing) because not every MACD divergence is going to be followed by a double bottom, but could still be a good trade. Either way, run the scan every day and make a watch list of the most promising results. Note that getting a hit does not guarantee a good trade (compare VIPS to BABA - same sector and industry, hit on the same scan, but different results - VIPS is under its falling long term MA, BABA is above its rising long term MA). You should back test the scan for random dates in the past (both versions) to get a feel for what makes a good hit or a bad hit.
For RSI crossing above 50, you need the "cross above" operator, which is "x", so
and [RSI(7) x 50]
Select max first. Edit it so 5 and MACD Signal(12,26,9) (or Line) are inside the parentheses. Then outside the parentheses put " < 0". All of that should be inside the brackets "[ ]".
Then select min. Edit it so 5 and RSI(7) are inside the parentheses. Then outside the parentheses add "<50". AND, in front of "min" put "1 day ago".
Then and the RSI x 50 line from the last answer.
[type = stock] AND [country = US] AND [Daily SMA(20,Daily Volume) > 40000]
and [optionable is true]
and [SMA(50) > SMA(200)]
and [Max 5 (MACD(12,26,9)) <0]
what is wrong with the above scan ?
and [optionable is true]
and [SMA(50) > SMA(200)]
and [Max(5, MACD Line(12,26,9)) <0]
The leading parenthesis for max( ) was misplaced.
For MACD you have to specify Line, Signal or Hist.
For clarity, it would be better to write sma(50, close) > sma(200, close).