[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Faster versions of Shark Scans



PureBytes Links

Trading Reference Links

Here are faster versions of my Shark long and short-sell scans, thanks to some
great editing by Mike Haggerty on SI. He's given the scans wings.

Long:

//Shark-32, by Walter T. Downs, 
     //translated for QP2 by Brooke
     //The idea behind the system is: Look for a three-bar shark pattern, 
     //based on progressively smaller ranges. It looks like a shark fin. Once 
     //that pattern appears, a level is set by the highest point in the fin,
     //which is the high(-2). In the scan, I call that level "Sharkhigh." To
     //get a buy signal, the price has to close above that level within 25
days. 

     output = "sharka.lst";
     input="volvol.lst";
     //ProcessMS = "d:\meta\macdup\",VMS;

     integer i, j;
     float shark, apex, WB, fin, sharkhigh, symmetry;

     for i = -24 to 0 step 1 do

     symmetry:=.28;
     apex:=(high(i)+low(i))/2;
     WB:=high(i-2)-low(i-2);

     if apex<=(high(i-2)-(WB*Symmetry)) and
     apex>=(low(i-2)+(WB*Symmetry)) then
     fin:=1;
     sharkhigh:=0;
     if high(i)<high(i-1) and
     low(i)>low(i-1) and
     high(i-1)<high(i-2) and
     low(i-1)>low(i-2) then
     shark:=fin;
     if shark=1 then 
     sharkhigh:=high(-2+i);
     endif;

     for j = 24 to 0 step -1 do

     if i+j <=0 then
     if close(i+j)>sharkhigh and
     close((i+j)-1)<sharkhigh and
     sharkhigh>0 and 
     shark =1 then
     println symbol,",", "Close: ", close(0):6:2,", ", "Change: ",
     Close(0)-Close(-1):5:2, ", ", "Date: ", date(i+j),", ", "Sharkhigh: ",
     sharkhigh; //date of buy signal
     endif;
     endif;
     next j;

     else
     shark:=0;
     endif;
     else
     fin:=0;
     endif;

     next i;



Short:


     //Shark-32, Short-Sell Version by Walter T. Downs, 
     //translated for QP2 by Brooke
     //The idea behind the system is: Look for a three-bar shark pattern, 
     //based on progressively smaller ranges. It looks like a shark fin. Once 
     //that pattern appears, a level is set by the highest point in the fin,
     //which is the high(-2). In the scan, I call that level "Sharkhigh." To
     //get a buy signal, the price has to close above that level within 25
days. 

     output = "sharka.lst";
     input="volvol.lst";
     //ProcessMS = "d:\meta\macdup\",VMS;

     integer i, j;
     float shark, apex, WB, fin, sharkhigh, sharklow, symmetry;

     for i = -24 to 0 step 1 do

     symmetry:=.28;
     apex:=(high(i)+low(i))/2;
     WB:=high(i-2)-low(i-2);

     if apex<=(high(i-2)-(WB*Symmetry)) and
     apex>=(low(i-2)+(WB*Symmetry)) then
     fin:=1;
     sharkhigh:=0;
     sharklow:=0;
     if high(i)<high(i-1) and
     low(i)>low(i-1) and
     high(i-1)<high(i-2) and
     low(i-1)>low(i-2) then
     shark:=fin;
     if shark=1 then 
     sharkhigh:=high(-2+i);
     sharklow:=low(-2+i);
     endif;

     for j = 24 to 0 step -1 do

     if i+j <=0 then
     if close(i+j)<sharklow and
     close((i+j)-1)>sharklow and
     sharklow>0 and 
     shark =1 then
     println symbol,",", "Close: ", close(0):6:2,", ", "Change: ",
     Close(0)-Close(-1):5:2, ", ", "Date: ", date(i+j),", ", "Sharklow: ",
     sharklow; //date of buy signal
     endif;
     endif;
     next j;

     else
     shark:=0;
     endif;
     else
     fin:=0;
     endif;

     next i;