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: Bob Jagow who wrote (6841)9/29/1998 9:13:00 AM
From: Sean W. Smith  Read Replies (2) of 11149
 
for i=numdays to 0 step 1 do
if close(i) >= maxHi then
maxHi := close(i);
maxDate := i;
i := 0;
endif;
next i;
for i=numdays to 0 step 1 do
if close(i) <= minLo then
minLo := close(i);
minDate := i;
i := 0;
endif;
next i;


Bob,

the above code will give erroneous results in the context of the scan I provided. Since MaxHi is set to 0 initially and MaxLo to 9999999 then your code will always exit on the first iteration. If one were to preset maxHi and maxLo to the actual values using the builtin in QP functions you could successfully exit the loop when these conditions were met. The way I wrote it it doesn't. I try using Min/Max to predetermine the hi/lo and kick out of the loop when its done and compare speed.

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