Richard Estes has pointed out that Walter Downs' Shark system also uses moving averages to establish trends. In the Metastock formulas, these are used in the Expert Advisor to add bullish and bearish labels to the chart. They're not part of the actual Shark buy and sell signals, but you could add the moving averages to the Quotes Plus scans, so that you get buy signals only when the averages are bullish, and sell signals when they're bearish.
Downs uses these formulas for bullish and bearish:
Bullish:
Mov(C,5,S)>Mov(C,20,S);
or in QP2: MovAvg(0,5,cl)>Mov(0,20,cl)
Bearish:
Mov(C,5,S)<Mov(C,20,S);
QP2: MovAvg(0,5,cl)<Mov(0,20,cl)
These can be added to the conditions in the QP2 scans to avoid buy signals in bearish periods, and sell signals in bullish times.
Here are the long and short scans with these conditions added:
//Shark-32, by Walter T. Downs, with Trend //translated for QP2 by Brooke, 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:=range(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;
if MovAvg(0,5,cl)>Mov(0,20,cl) then if shark=1 then if sharkhigh>0 then for j = i to 0 step 1 do if close(j)>sharkhigh then if close(j-1)<sharkhigh then println symbol,",", "Close: ", close(0):6:2,", ", "Change: ", Close(0)-Close(-1):5:2, ", ", "Date: ", date(j),", ", "Sharkhigh: ", sharkhigh; //date of buy signal j:=0; endif; endif; next j; endif; endif; endif;
else shark:=0; endif;
else fin:=0; endif; next i;
************************
Short:
//Shark-32, Short-Sell Version, with Trend, by Walter T. Downs, //translated for QP2 by Brooke, output = "sharkshort.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:=range(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; if MovAvg(0,5,cl)<MovAvg(0,20,cl) then if shark=1 then if sharklow>0 then for j = i to 0 step 1 do if close(j)<sharklow then if close(j-1)>sharklow then println symbol,",", "Close: ", close(0):6:2,", ", "Change: ", Close(0)-Close(-1):5:2, ", ", "Date: ", date(j),", ", "Sharklow: ", sharklow; //date of buy signal j:=0; endif; endif; next j; endif; endif; endif;
else shark:=0; endif; else fin:=0; endif; next i; |