Try this version

output="efficiencyratio20";
exchange=nyse, Nasdaq, amex;
issuetype=common;
 
Float f;
f := (ABS ( close(0) - close(-1))  + abs(close(-1) - close(-2)) +
Abs(close(-2) -close(-3)) + abs(close(-3) - close(-4)) +abs(close(-4) - 
close(-5)) +
abs(close(-5) - close(-6)) + abs(close(-6) - close(-7)) + Abs(close( -7) 
- close(-8)) +
abs(close(-8) - close(-9)) + abs(close(-9) - close (-10)) 
+abs(close(-10)- close(-11)) +
abs(close(-11) - close(-12)) + abs(close(-12) - close(-13)) + 
abs(close(-13) - close(-14)) +
abs(close(-14) - close(-15)) + abs(close(-15) - Close(-16)) + 
abs(close(-16) - close(-17)) +
abs(close(-17) - close(-18)) + abs(close(-18) - close(-19)) + 
abs(close(-19) - close(-20)));

if f > 0 then

if 100*(close(0) - close(-20)) /  f >=  29.85 and

100*(close(0) - close(-20)) / f  <= 38 and close(0) >=15 and close(-1) 
 >= 15 and close(-3) >=15 and
Close(0)>close(-1) and close(-1)>close(-2) then

println symbol;
endif;
endif;

Howard

Alan Craig wrote:
>
> Thanks Gary.  I tried to run the scan you sent but received the 
> following messages:
>
> unexpected '=' Line: 11
> unexpected '=' Line: 19
> uninitialized variance, Line:27
> uninitialized variance, Line: 27
>
> Not sure what to do now.  Hope you can remedy this.  Thanks
>
> Alan
>
>
>
> */gary <[EMAIL PROTECTED]>/* wrote:
>
>      
>     I haven't tested this, but the idea is to calculate the
>     denominators first, and make sure that they are not zero, then you
>     can do the division.
>      
>      
>     Best regards
>      
>     Gary
>      
>
>     float val1;
>     float val2;
>      
>     val1 = (ABS ( close(0) - close(-1))  + abs(close(-1) - close(-2)) +
>     Abs(close(-2) -close(-3)) + abs(close(-3) - close(-4))
>     +abs(close(-4) - close(-5)) +
>     abs(close(-5) - close(-6)) + abs(close(-6) - close(-7)) +
>     Abs(close( -7) - close(-8)) +
>     abs(close(-8) - close(-9)) + abs(close(-9) - close (-10))
>     +abs(close(-10)- close(-11)) +
>     abs(close(-11) - close(-12)) + abs(close(-12) - close(-13)) +
>     abs(close(-13) - close(-14)) +
>     abs(close(-14) - close(-15)) + abs(close(-15) - Close(-16)) +
>     abs(close(-16) - close(-17)) +
>     abs(close(-17) - close(-18)) + abs(close(-18) - close(-19)) +
>     abs(close(-19) - close(-20)));
>      
>     val2 = (ABS ( close(0) - close(-1))  + abs(close(-1) - close(-2)) +
>     Abs(close(-2) -close(-3)) + abs(close(-3) - close(-4))
>     +abs(close(-4) - close(-5)) +
>     abs(close(-5) - close(-6)) + abs(close(-6) - close(-7)) +
>     Abs(close( -7) - close(-8)) +
>     abs(close(-8) - close(-9)) + abs(close(-9) - close (-10))
>     +abs(close(-10)- close(-11)) +
>     abs(close(-11) - close(-12)) + abs(close(-12) - close(-13)) +
>     abs(close(-13) - close(-14)) +
>     abs(close(-14) - close(-15)) + abs(close(-15) - Close(-16)) +
>     abs(close(-16) - close(-17)) +
>     abs(close(-17) - close(-18)) + abs(close(-18) - close(-19)) +
>     abs(close(-19) - close(-20))) ;
>      
>
>     if val1 > 0 and val2 > 0
>     then
>      
>       if 100*(close(0) - close(-20)) / val1 >=  29.85 and
>     100*(close(0) - close(-20)) / val2 <=38
>         and close(0) >=15 and close(-1) >= 15 and close(-3) >=15 and
>     Close(0)>close(-1) and
>         close(-1)>close(-2)
>         then
>      
>           println symbol;
>         endif;
>     endif;
>      
>      
>      
>      
>      
>
>         ----- Original Message -----
>         *From:* Alan Craig <mailto:[EMAIL PROTECTED]>
>         *To:* [email protected]
>         <mailto:[email protected]>
>         *Sent:* Wednesday, June 13, 2007 8:15 PM
>         *Subject:* [quotes-plus] Problem with scan
>
>         I am having a problem with a scan I am trying to run.  The
>         scan gets through the
>         "D's" in the database and lists a number of symbols but then
>         the scan stops and I get a "Division by Zero"  error message. 
>         Does anyone know how I can stop this from happening or do I
>         have to change something in the scan?  Thanks for any
>         assistance you can give me.  Below is the scan I am running:
>
>         Alan
>
>         
> ----------------------------------------------------------------------------------------------
>
>         output="efficiencyratio20";
>         exchange=nyse, Nasdaq, amex;
>         issuetype=common;
>
>         if 100*(close(0) - close(-20)) / (ABS ( close(0) - close(-1)) 
>         + abs(close(-1) - close(-2)) +
>         Abs(close(-2) -close(-3)) + abs(close(-3) - close(-4))
>         +abs(close(-4) - close(-5)) +
>         abs(close(-5) - close(-6)) + abs(close(-6) - close(-7)) +
>         Abs(close( -7) - close(-8)) +
>         abs(close(-8) - close(-9)) + abs(close(-9) - close (-10))
>         +abs(close(-10)- close(-11)) +
>         abs(close(-11) - close(-12)) + abs(close(-12) - close(-13)) +
>         abs(close(-13) - close(-14)) +
>         abs(close(-14) - close(-15)) + abs(close(-15) - Close(-16)) +
>         abs(close(-16) - close(-17)) +
>         abs(close(-17) - close(-18)) + abs(close(-18) - close(-19)) +
>         abs(close(-19) - close(-20))) >=  29.85 and
>
>         100*(close(0) - close(-20)) / (ABS ( close(0) - close(-1))  +
>         abs(close(-1) - close(-2)) +
>         Abs(close(-2) -close(-3)) + abs(close(-3) - close(-4))
>         +abs(close(-4) - close(-5)) +
>         abs(close(-5) - close(-6)) + abs(close(-6) - close(-7)) +
>         Abs(close( -7) - close(-8)) +
>         abs(close(-8) - close(-9)) + abs(close(-9) - close (-10))
>         +abs(close(-10)- close(-11)) +
>         abs(close(-11) - close(-12)) + abs(close(-12) - close(-13)) +
>         abs(close(-13) - close(-14)) +
>         abs(close(-14) - close(-15)) + abs(close(-15) - Close(-16)) +
>         abs(close(-16) - close(-17)) +
>         abs(close(-17) - close(-18)) + abs(close(-18) - close(-19)) +
>         abs(close(-19) - close(-20))) <=38
>         and close(0) >=15 and close(-1) >= 15 and close(-3) >=15 and
>         Close(0)>close(-1) and
>         close(-1)>close(-2) then
>
>         println symbol;
>         endif
>
>
>
>
>
>
>
>
>
>         
> ------------------------------------------------------------------------
>         Pinpoint customers
>         
> <http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50>who
>         are looking for what you sell.
>
>
> ------------------------------------------------------------------------
> Park yourself in front of a world of choices in alternative vehicles.
> Visit the Yahoo! Auto Green Center. 
> <http://us.rd.yahoo.com/evt=48246/*http://autos.yahoo.com/green_center/;_ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2VudGVy>
>  
>
>  

Reply via email to