Here ya go!!!
.............. output ="hammer.lst";
Float BODY, UPPER, LOWER; Integer X;
X := 0; BODY := Abs(Open(X) - Close(X));
if (BODY = 0) then BODY := .01; endif;
if Close(X) >= Open(X) then UPPER := High(X) - Close(X); LOWER := Open(X) - Low(X); else UPPER := High(X) - Open(X); LOWER := Close(X) - Low(X); endif;
if ((downgap(X) >= .01) & (AvgVol(X,X-29) > 25000) & ((UPPER/BODY) <= .05) & (LOWER >= (BODY*2)) & (MovAvg(X,5,cl) < MovAvg(X-1,5,cl)) & (MovAvg(X-1,5,cl) < MovAvg(X-2,5,cl))) then
println symbol,",",Close(X),", ",Vol(X),", ",AvgVol(X,-29);
endif; ...........
This scan searches for hammer that have a gap down, which limits the number of hits greatly, but makes a better signal. If you take out " (downgap(X) >= .01) & " then the down gap will not be neccesary.
Rusty |