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

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Debra Orlow who wrote (8918)3/11/1999 1:18:00 PM
From: Sean W. Smith  Read Replies (1) of 11149
 
Here ya go....

output = "brkout310.lst";
input = "vol250.lst";
//ProcessMS = "e:\breakout\brkout310",MSdata;

integer numDaysToExclude; // Number of days to back to exclude
integer triggeredPrior; // Boolean Flag
integer i; // Index Variable

numDaysToExclude := 1;
triggeredPrior := 0;

numDaysToExclude := numDaysToExclude * -1;

for i = numDaysToExclude to -1 step 1 do
if ( close(i) > max(i-1,i-20,hi) or
close(i) < min(i-1,i-20,lo) ) and
( Vol(i) > (AvgVol(i,i-40)*1.4) ) then
triggeredPrior := 1;
endif;
next i;

if ( close(0) > max(-1,-20,hi) or
close(0) < min(-1,-20,lo) ) and
( Vol(0) > (AvgVol(0,-40)*1.4) and
(triggeredPrior = 0) ) then
println symbol , "," , Description;
endif;

The trick is to use a loop to back test and set a flag if a match occurs. Then when scanning the final day check to see that the flag has not been set.

change numDaystoExclude to exlcude more matches as you go back in time.

Sean
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext