SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: Craig DeHaan who wrote (6734)9/22/1998 1:47:00 PM
From: TechTrader42  Respond to of 11149
 
Here's a Four-Bar Fear scan for shorts and longs. I like the Four-Bar system. Look at one of last night's picks: ITIG. As for your hypothetical, I'm not sure I even want to think about it. Too much code whirling in my head. With the "Sum" and all, I'm not sure how logical a 2-day alert would be. But as Tweedledee said: "If it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic."

Here's the Four-Bar Fear Scan for Shorts and Longs:

//Four-Bar Fear, Shorts and Longs, by Walter T. Downs
//translated for QP2 by Brooke
//n := 12 {Time periods};
//BullFear := (HHV(HIGH,n) - LLV(HIGH,n))/2 + LLV(HIGH,n);
//BearFear := (HHV(LOW,n) - LLV(LOW,n))/2 + LLV(LOW,n);
//Longs:
//Alert(Cross(CLOSE,BullFear) AND Ref(Sum(CLOSE <
//BullFear AND CLOSE > BearFear,4),-1) = 4,1)
//Shorts:
//Cross(BearFear,CLOSE) AND Ref(Sum(CLOSE <
//BullFear AND CLOSE > BearFear,4),-1) = 4

output = "fourbar.lst";
input="volvol.lst";

integer periods, i;
float bullfear, bearfear, bullfprev,
bearfprev, flag;

periods:=11;

bullfear:=(max(0,-periods,hi)-min(0,-periods,hi))/2 +
min(0,-periods,hi);

bearfear:=(max(0,-(periods),lo)-min(0,-periods,lo))/2 +
min(0,-periods,lo);

flag:=0;
for i = 0 to -3 step -1 do
bullfprev:=(max(i-1,-((periods+1)-i),hi)
-min(i-1,-((periods+1)-i),hi))/2 +
min(i-1,-((periods+1)-i),hi);
bearfprev:=(max(i-1,-((periods+1)-i),lo)-
min(i-1,-((periods+1)-i),lo))/2
+ min(i-1,-((periods+1)-i),lo);

if close(i-1)<bullfprev and
close(i-1)>bearfprev then
flag:=flag+1;
endif;

next i;

if close(0)>bullfear
and flag=4 then
println symbol,",", "Buy: ", "Close: ", close(0):6:2,", ",
"Change: ", Close(0)-Close(-1):5:2, ", ",
"Bullfear: ", bullfear;
endif;

if close(0)<bearfear
and flag=4 then
println symbol,",", "Short: ", "Close: ", close(0):6:2,", ",
"Change: ", Close(0)-Close(-1):5:2, ", ",
"Bearfear: ", bearfear;
endif;



To: Craig DeHaan who wrote (6734)9/22/1998 8:20:00 PM
From: TechTrader42  Read Replies (5) | Respond to of 11149
 
I've looked at the cup & handle article by Martinelli and Hyman in the latest issue of TASC, and it would be possible to formulate the ideas for QP2, I think -- if I had a super computer.

The problem is that my computer and QP2 can't handle all the formulas and loops. The idea is based on finding points that identify cups. As the article says, let K be the point farthest back in time, before the first rim of the cup is established. The price at point K is less than that at point A, the firsr rim of the cup. Then price falls to the base of the cup, point B. Then it rises to point C, the other rim of the cup. Finally, the handle is formed with points D and E.

Think about all the possible combinations of prices over, say, 100 days that might form the pattern in just the cup, without the handle. Even if you add percentages for setting the levels of the base, rims and handle, there are many possibilities. Too many for QP2 -- and for my Altair 8800 computer, built from a kit several decades ago.

I've formulated the most basic idea behind just the cup, without the handle. The idea is that K < A, B < A, and B < C. Oh, and A<=C. Now the job is to write a scan looking for that pattern over a given period. If I use 100 days, the scan program freezes. So I settled for 10 days, just to see whether the scan would be possible. And I limited the number of possible price patterns, by limiting the number of days in some of the loops.

The scan isn't useful for finding cups, of course. It's just an attempt to see what might be involved. I'll include part of the the output after the scan. You can see in the output how the prices do meet the pattern, with K less than A, A less than B, and B less than C.

Anyway, talk about silly endeavors. I dream up most of these things while on walks with my husband. He chatters on and on about politics, and I lose myself in this foolishness:

output="cup.lst";
input="volvol.lst";

integer k, a, b, c;
float pointk, pointa, pointb, pointc;

pointa:=0;
pointb:=0;
pointc:=0;
pointk:=0;
for k = -10 to 0 step 1 do
pointk:=k;
for a = 6 to 0 step -1 do
pointa:=k+a;
for b = 3 to 0 step -1 do
pointb:=k+a+b;
for c = 2 to 0 step -1 do
pointc:=k+a+b+c;

if pointa<=0 then
if pointb<=0 then
if pointc<=0 then
if pointk<pointa then
if pointa<pointb then
if pointb<pointc then
if close(pointk)<close(pointa) then
if close(pointb)<close(pointa)then
if close(pointb)<close(pointc)then
if close(pointc)<=close(pointa)then
println symbol, ", ", pointk, ", ", pointa, ", ", pointb,
", ", close(pointk), ", ", close(pointa), ", ", close(pointb);
endif; endif; endif; endif; endif; endif; endif; endif; endif; endif;

next c;
next b;
next a;
next k;

*********************************

In the following output, the first four numbers represent the days of K, A, B and C. The last four numbers are the closes on those days. Note how they meet the conditions. Day K has to occur before day A, day A before day B, and day B before day C. And the close on day K must be less than the close on day A. Then the close on day B must be less than daya A and C. (B is the base.)

AAPL , -10, -4, -1, 0, 35.125, 38.1875, 36.75, 36.9375
AAPL , -10, -4, -2, 0, 35.125, 38.1875, 36, 36.9375
AAPL , -10, -4, -2, -1, 35.125, 38.1875, 36, 36.75
AAPL , -10, -5, -2, 0, 35.125, 37.1875, 36, 36.9375
AAPL , -10, -5, -2, -1, 35.125, 37.1875, 36, 36.75
AAPL , -10, -6, -5, -3, 35.125, 37.625, 37.1875, 37.3125
AAPL , -10, -7, -5, -3, 35.125, 38.125, 37.1875, 37.3125
AAPL , -10, -8, -5, -3, 35.125, 37.375, 37.1875, 37.3125
AAPL , -10, -9, -6, -4, 35.125, 38.25, 37.625, 38.1875
AAPL , -10, -9, -8, -6, 35.125, 38.25, 37.375, 37.625
AAPL , -10, -9, -8, -7, 35.125, 38.25, 37.375, 38.125
AAPL , -8, -4, -1, 0, 37.375, 38.1875, 36.75, 36.9375
AAPL , -8, -4, -2, 0, 37.375, 38.1875, 36, 36.9375
AAPL , -8, -4, -2, -1, 37.375, 38.1875, 36, 36.75
AAPL , -8, -6, -5, -3, 37.375, 37.625, 37.1875, 37.3125
AAPL , -8, -7, -5, -3, 37.375, 38.125, 37.1875, 37.3125
AAPL , -7, -4, -1, 0, 38.125, 38.1875, 36.75, 36.9375
AAPL , -7, -4, -2, 0, 38.125, 38.1875, 36, 36.9375
AAPL , -7, -4, -2, -1, 38.125, 38.1875, 36, 36.75
AAPL , -6, -4, -1, 0, 37.625, 38.1875, 36.75, 36.9375
AAPL , -6, -4, -2, 0, 37.625, 38.1875, 36, 36.9375
AAPL , -6, -4, -2, -1, 37.625, 38.1875, 36, 36.75
AAPL , -5, -3, -1, 0, 37.1875, 37.3125, 36.75, 36.9375
AAPL , -5, -3, -2, 0, 37.1875, 37.3125, 36, 36.9375
AAPL , -5, -3, -2, -1, 37.1875, 37.3125, 36, 36.75
AAPL , -5, -4, -1, 0, 37.1875, 38.1875, 36.75, 36.9375
AAPL , -5, -4, -2, 0, 37.1875, 38.1875, 36, 36.9375
AAPL , -5, -4, -2, -1, 37.1875, 38.1875, 36, 36.75
ABF , -10, -9, -6, -4, 19.5625, 19.875, 18.5625, 18.75
ABF , -10, -9, -6, -5, 19.5625, 19.875, 18.5625, 18.9375
ABF , -10, -9, -7, -5, 19.5625, 19.875, 18.0625, 18.9375
ABF , -10, -9, -7, -6, 19.5625, 19.875, 18.0625, 18.5625
ABF , -8, -5, -4, -2, 18.5625, 18.9375, 18.75, 18.8125
ABF , -7, -5, -4, -2, 18.0625, 18.9375, 18.75, 18.8125
ABF , -6, -5, -4, -2, 18.5625, 18.9375, 18.75, 18.8125
ADAC , -10, -5, -2, 0, 27.5, 29.5, 28.75, 29.4375
ADAC , -10, -5, -4, -3, 27.5, 29.5, 29, 29.375
ADAC , -10, -7, -4, -3, 27.5, 29.625, 29, 29.375
ADAC , -10, -7, -6, -4, 27.5, 29.625, 28.5625, 29
ADAC , -10, -7, -6, -5, 27.5, 29.625, 28.5625, 29.5
ADAC , -10, -9, -6, -4, 27.5, 30.625, 28.5625, 29
ADAC , -10, -9, -6, -5, 27.5, 30.625, 28.5625, 29.5
ADAC , -10, -9, -8, -6, 27.5, 30.625, 28.375, 28.5625
ADAC , -10, -9, -8, -7, 27.5, 30.625, 28.375, 29.625
ADAC , -8, -5, -2, 0, 28.375, 29.5, 28.75, 29.4375
ADAC , -8, -5, -4, -3, 28.375, 29.5, 29, 29.375
ADAC , -8, -7, -4, -3, 28.375, 29.625, 29, 29.375
ADAC , -8, -7, -6, -4, 28.375, 29.625, 28.5625, 29
ADAC , -8, -7, -6, -5, 28.375, 29.625, 28.5625, 29.5
ADAC , -6, -5, -2, 0, 28.5625, 29.5, 28.75, 29.4375
ADAC , -6, -5, -4, -3, 28.5625, 29.5, 29, 29.375
ADBE , -10, -8, -7, -6, 24.4375, 28, 26.8125, 28
ADBE , -9, -8, -7, -6, 25.6875, 28, 26.8125, 28