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

Correction in QP2 Shark scan



PureBytes Links

Trading Reference Links

There's an error in the QP2 shark scan I sent. "Symmetry" should be in the
float, not under integers. This led to a few disparities in hits with
Metastock and QP2. Here's the fixed version:

//Shark-32, by Walter T. Downs, translated for QP2 by Brooke

//Shark:=If((H<Ref(H,-1) AND L>Ref(L,-1) AND
// Ref(H,-1)<Ref(H,-2) AND Ref(L,-1)>Ref(L,-2))=1,
//If(apex <= (Ref(H,-2)-(WB*Symmetry)) AND
// Apex >= (Ref(L,-2)+(WB*Symmetry)) ,1,0),0);

output = "shark.lst";
input="commplus.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;
else fin:=0;
endif;

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;
else shark:=0;
endif;

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 
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 is date when shark equals 1, not date of
signal
endif;
endif;
next j;

next i;