No position in certain deciles?

Apologies if this question has already been answered. - I could not resolve it by looking at the help files.

I’m trying to rank the stocks according to their P/E ratios.

Then I want to rank the highest ranking 20 percent (those with the lowest PE) according to their Price 2 Book ratios. Thus I want 5 buckets according to PE and within each PE bucket, I want 5 PB buckets - all together 25 buckets.

Then I’d like to run a backtest for each of these buckets and note the annualized return and sharpe ratio.

(1) I have a screener that can be modified according to each bucket. For a particular bucket, the rules are:

MktCap > 50
20 > FRank("PEExclXorTTM", #Previous, #ASC) AND FRank("PEExclXorTTM", #Previous, #ASC) >= 0
100 > FRank("Pr2BookQ", #Previous, #ASC) AND FRank("Pr2BookQ", #Previous, #ASC) >= 80

But for the bucket above, the backtesting tool has no positions for the entire backtesting period. (Max period.)
This makes no sense, as I just want companies to be ranked relatively to one another. I don’t want companies to be eliminated.

(2) Is there a better way to do this? The ranker tool doesn’t give me the precise numbers for annualized rate of return and Sharpe ratio. I’ve run a backtest for every bucket so far. Should I be looking into the optimizer tool?

Where am I going wrong?

It probably has to do with N/A entries. You should exclude them before your FRank rules.

The issue is with NAs.

Try ShowVar(@FRank,FRank("PEExclXorTTM", #Previousl, #ASC)) & (ShowVar(@PE,PEExclXorTTM))
and sort on the PE column.

Walter

Thanks - can someone explain to me what’s happening as opposed to just giving me the solution? I would like to understand what’s going on, so that I can solve the issue myself next time should something similar happen.

Is there a way to just drop all N/A companies?

NAs are a product of either nulls in the database or divide-by-zero errors. The best way to get rid of them when dealing with ranking systems is to create a custom universe. Write a rule that includes the stuff that you’re looking for in a rule linked with an “or”:

PEExclXorTTM or SalesTTM

for example.

That will eliminate any companies with NAs for those two data points.

Aren’t Universes static (i.e. fixed before sim is run) while NA’s for a line item will change over time?

I believe that the Universe is recalculated for each rebalance and therefore will also change with time.

Walter

Can I just use the following to filter out all NA companies?

“PEExclXorTTM != NA and Pr2BookQ != NA”

It seems to have worked but I’m not sure it’s doing what I hope it is doing.

Or perhaps the following more mundane:

“PEExclXorTTM > 0 and Pr2BookQ > 0”