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: Peter Timaratz who wrote (4126)5/3/1998 4:21:00 PM
From: Bob Jagow  Read Replies (2) of 11149
 
Right, Peter, you can write an explicit if in R2 to test for the div/0--
---------------------
YearlyLow:= Min(-1,-250,cl);
if YearlyLow > 0 then
CPM:= Close(0)/YearlyLow ;
endif;
----------------------
But, unfortunately,
------
If YearlyLow > 0 and Close(0)/YearlyLow > 1 then
println symbol;
endif;
-------------------
would crash with a div/0 for the same reason your original
-----------------
YearlyLow:= Min(-1,-250,cl)
YearlyLow > 0
CPM:= Close(0) / YearlyLow
-----------------
crashed--neither R1 nor R2 implement 'short-circuit' evaluation.
Lack of this feature, which is standard in most modern languages
except Pascal (Wirth fixed that for Modula), also impacts how you should
write R1 and R2 scans.
Since all conditions will be evaluated (AllGroup cond1 cond2 cond3
is identical to if cond1 and cond2 and cond3 then), a prescan to
narrow the original database to stocks of interest to you will speed
things considerably.

Exiting my soapbox ;)
Bob
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext