STOCK SCREEN CRITERIA

I’ve made a stock screen with 10 criteria, but I want to include stocks that pass any 7 of the 10 criteria. Is there a way to do this?

Yes - do you know how to create variables using SetVar()?

If so then create 10 variables, one for each rule. For example, your first rule might be to allow MktCap greater than $100M. So the variable would be set as follows:

SetVar(@V1,Eval(MktCap>100,1,0))

Now add up the ten variables and test for greater than or equal to 7

@V1+@V2+…+@V10 >= 7

Steve

For the optional rules 7-10, inlude them all in one line separated by logical OR

Do I need to separately set these variables, or can I do this on the stock screen page as a rule? So for example my first rule can just be SetVar(@V1,Eval(MktCap>100,1,0)) - without having to set anything before that?

Also…
I’m not sure how the @V1+@V2+…+@V10 >= 7 formula works. If a stock meets the first criteria, let’s say that’s Eval(MktCap>100,1,0), is it just given a value of 1? I want to prevent P123 from screening stocks in the order of the criteria, so that if a stock doesn’t meet that first criteria, it will still check to see if it meets the second, third, and so on.

Yes you can but all the SetVar rules in the screen. As the system checks each variable in order it will add a 1 or a 0 depending on weather or not the stock passed the variable. after all variables have been tested if the sum is 7 or more the stock will pass the screen. If less than 7 the stock will be rejected.

Thanks Steve, that is a neat approach!

Sister - the idea is for ANY 7 of the 10 rules to pass. There would be no optionals so you want to use plus signs, not ORs.
Steve

ncelio - the SetVar rule is inert i.e. it doesn’t affect the outcome of the screen.
Steve

Another simplified version of Steve’s approach is to skip the Eval() function and just do
(MktCap > 100) + (Price > 2)
for example.
That’s because in P123 logic TRUE =1