Here's an attempt at a cup & handle scan based on some of the ideas in Martinelli and Hyman's article in the October issue of TASC. It turns up a few possible candidates, such as AT and WIND, and some not-so-good candidates. You have to check the charts to see if the hits really do have cup-and-handle formations. The output looks like this:
AT , 48.81, 38.25, 46.38, 40.62, Date A: 03/11/1998, Date B: 08/05/1998, Date C: 08/28/1998, Date D: 09/11/1998, Dates A-B: -102, Dates B-C: -17, Dates C-D: -9
The four prices after the symbol are those of points A, B, C and D. (The points are described in the article.) I've left out the cup "setup," Point K. Point A is the left rim of the cup, Point B the base, Point C the right rim, and Point D the handle.
Next, the output gives the dates of each point.
Finally, the negative numbers represent the number of days between each point. For example, there are 102 days between points A and B in AT's supposed cup.
Here it is. Have fun drinking from the cup. It's a flawed scan, but it's really just a first attempt.
//Cup and Handle Scan, by Brooke Elise Nagler, //based on "Cup-With-Handle and the Computerized Approach //by Rich Martinelli and Barry Hyman in October 1998 issue of TASC
output="cup.lst"; input="commplus.lst"; DaysRequired=200; Daystoload=250;
integer i, j, k, l, datea, dateb, datec, dated; float pointa, pointb, pointc, pointd;
pointd:=min(0,-14,lo); pointc:=max(-5,-30,hi); pointb:=min(-8,-55,lo); pointa:=max(-28,-155,hi);
dated:=0; datec:=0; dateb:=0; datea:=0; for i = -14 to 0 step 1 do if low(i)=pointd then dated:=i; endif; next i; for j = -30 to -5 step 1 do if high(j)=pointc then datec:=j; endif; next j; for k = -55 to -8 step 1 do if low(k)=pointb then dateb:=k; endif; next k; for l = -155 to -28 step 1 do if high(l)=pointa then datea:=l; endif; next l;
if pointc>1.12*pointb then if pointc<1.45*pointb then if pointa>1.12*pointb then if pointc<1.45*pointb then if pointc>=.95*pointa then if pointd<(.8*pointc)+(.2*pointb) then if datea< dateb then; if dateb< datec then; if datec< dated then; if datea-dateb<=-20 then if datea-dateb>=-120 then if dateb-datec<=-3 then if datec-dated<=-5 then println symbol, ", ", pointa:5:2, ", ", pointb:5:2, ", ", pointc:5:2, ", ", pointd:5:2, ", ", "Date A: ", date(datea), ", ", "Date B: ", date(dateb), ", ", "Date C: ", date(datec), ", ", "Date D: ", date(dated), ", ", "Dates A-B: ", datea-dateb, ", ", "Dates B-C: ", dateb-datec, ", ", "Dates C-D: ", datec-dated; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif; endif;
|