The way that I usually do it is in the screener. Use SetVar:
SetVar(@1,MktCap>2000)
SetVar(@2,ROI%TTM>5)
The final rule of a scoring system will then be:
@1+@2>=1
Or whatever the scoring will be.
Use this to see the value:
ShowVar(@score,@1+@2)
There will be a column in the screener report Screen Factors that will be headed @score, with the value. In this case that value will be 0,1 or 2.
You can also do this in custom formulas, particularly if you need it as part of a strategy.
Custom Formula 1
Name: 1
Formula:
MktCap>2000
Custom Formula 2
Name: 2
Formula:
ROI%TTM>5
Custom Formula 3
Name: Score
Formula:
$1+$2
The rule (screen or strategy) would then be:
$Score>=1
And $Score can be used in screen reports.
Note that in general you’d probably have more than two terms for this (otherwise it’s easier to just use an “or”). Note also that a scoring value of this sort will be lousy for purposes of ranking because of the limited number of discrete values. This will be true of most scoring systems.
Error:
Ranking failed on 01/01/2005: In ‘ROA 5y Variability < Industry Average’-> Error near ‘$incomevariability’: Invalid command ‘$incomevariability’
Any idea on how to fix this? Many thanks for your time!
Monraham wanted the ratio of R&D to assets to be less than the industry median. When I wrote this formula, it seemed to me that there was no distinction between companies with RandDA = 0 and RandDA = NA–in other words, they were equivalent. But in a ranking system, NA would be ranked lower than 0, which would mean that in industries in which nobody spent any money on R&D, 0 R&D companies would rank higher than NA R&D companies. That’s why I put IsNA(RandD,0) there. The rest of the formula simply says that if a company spends more money on R&D than the median in the industry it gets a point and if it doesn’t, it doesn’t.
I’m afraid I don’t understand the “business case” here. And given what we have on our to-do list, I can’t see this being a very high priority. I wish I could be more helpful!
JMH is the most polite person on the form with the most polite way of asking for something. He didn’t even ask for anything here. He just politely wants to know how much trouble it would be.
And obviously, if there is a reason to do this with ranks (which P123 does) if might be useful with Frank. There can be no doubt that this is a reasonable thing for JMH to want.
If I used Frank I would want to set it as neutral for NAs for a number of specific purposes. Fortunately for me, not for any purpose that cannot use regular rank at this time.
Very good thing for me as not having this option in the ranking system would cost me tens of thousands of dollars per year.
I am not a professional programmer, but how NAs are to be handled has been one of the first things discussed in any (all) programming course(s) I have ever taken. It is one of the most basic thing to be considered in programming. It should be a consideration for everyone—not just JMH.
The business case would be that JMH is a long-time user that has been, not just polite, but a strong vocal supporter of P123 and is making a reasonable request here.
There may be other higher priorities but there is a business case. Of that there can be no doubt.
As the booleans True and False are the integers 1 and 0 in P123 rule language like in many programming languages, you can remove most, if not all, eval functions from the formula, which will greatly improve readability and also allow putting more code in the maximum length of a formula.
Basically eval(roa%ttm>roa%ttmind,1,0) and roa%ttm>roa%ttmind are equal, even when one side of the “>” is “NA”.