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 -- Ignore unavailable to you. Want to Upgrade?


To: Ron Oda who wrote (8125)12/14/1998 2:21:00 PM
From: unixgeek  Read Replies (1) | Respond to of 11149
 
integer flag;
flag := 0;

For i = 0 to -60 step -1
Do
If AvgVol(i,i-50)>=500000 and
AvgVol(i,i-4)>=2.5*AvgVold(-5,i-50) then
flag := 1;
endif;
next i;

if flag = 1 then
println symbol;
endif;

Or something on that order.

This will set flag to 1 possibly many times, but once it's set
it never gets 'reset' until the next stock. It would be nice
if there were a way to exit the loop early, so you could println
the symbol, then move on to the next stock and not have to iterate
through the rest of the values. I haven't tried it, but
setting i to some value outside the loop boundry _may_ work.



To: Ron Oda who wrote (8125)12/15/1998 2:15:00 PM
From: holland  Read Replies (1) | Respond to of 11149
 
Try this it doesn't require the flag variable.

For i = 0 to -60 step -1
Do
If AvgVol(i,i-50)>=500000 and
AvgVol(i,i-4)>=2.5*AvgVold(-5,i-50) then
println symbol;
i := 0; // added to stop loop
endif;
next i;
Please note the addition of i:= o;