Finding stocks with Rank equal to RankPos=1

Hi all,

in P123 under taxonomy there is a way to rank each industry by a variety of pre-set factors:
https://www.portfolio123.com/app/taxonomy/stock/usa/industry

Using FMedian I have set up a one-factor ranking system which ranks stocks based on the same system. For example, for surprise%Q1 the formula used in the single node is
FMedian(“Surprise%Q1”,#Industry)

When I list the outcome in a screener and sort by rank, I get ranks like in the below image.

As a next step I would like to consider only the stocks in the top industry, in this case MATCONST. For this to be true and universal (as number of stocks in each industry are very different), I need a rule which says:

Rank is equal to Rank of RankPos=1

In my example, this rule would only consider the first 16 stocks in the screener.

Does anybody know how I can achieve this?

Br,
Florian


industry_screen.bmp (2.1 MB)

Sister - try this:

https://www.portfolio123.com/app/screen/summary/167508?mt=1
https://www.portfolio123.com/app/ranking-system/294460

Steve

Great, Steve!

FOrder is a great rule, and if I want to include the 3 best industries I would just say FOrder(“Rank”,#All,#DESC,TRUE)<4.

The tricky part now is to implement this into a simulation buy rule where the sim rank is different from this single factor industry rank. I guess I somehow need to verify that the stock is part of the single factor rank. Something like…?

Rating(“TestRank”)>0

I’m not sure that what you want to do is possible but I’ll think about it for a while.
Steve

sevensisters,

Try this:

Set the main Rank to main you main ranking system - for example “Comprehensive: QVG”

Screen rules:

Forder(“rank”,#industry)<=10 //Select the top 10 candidates from each industry according to your main ranking system.
Rating(“TestRank”)>90 //Filter only the ones from the best industries (Where “TestRank” is your Industry’s rank). if you want only the best Industry set it to >99.9

Ohad

Ohad - there is no guarantee that 99.9 will work for all cases. It looks like it is universe dependent and the number could vary depending on the number of stocks in the universe on any particular day. If the universe is a constant size then the this will work but you have to determine what the threshold should be. For the S&P 500 you would need to use 99.7.
Steve

Steve,

Sure, thanks for clarify that. Its will not work for all cases, it aimed to work for All fundamentals universe. For a different universe, the number of industries in the universe is whats counts (not the number of stocks) and the threshold should be tuned by it. The Industry rank should be setup in a way that each stock from the same industry gets the same rank, then only the number of industries in the universe counts)

Ohad

I’m not sure I understand how the ranking algorithm works. Perhaps you have a better grasp of this.

You are probably right that the top rank is dependent on the number of industries, but if you wanted to screen for the top four industries, there might be an issue. I had a quick glance at the rankings for S&P 500 stocks. It appears that as you move down the rankings, the spacing between industries varies. I think the drop in rank must be dependent on the number of stocks ranked above.

Steve

Steve

Yes, you are correct. The spacing between industries varies according to the number of stocks in each industry. To bypass that we should use this screen:

Forder(“rank”,#industry)<=10 //Select the top 10 candidates from each industry according to your main ranking system.
Setvar(@Indrank,Rating(“TestRank”))
Forder(“@Indrank”,#previous,#desc,True)<=3 //Selects the top 3 Industries according to the “TestRank”

If the number of the stocks in one of the top 3 industry is less then 10, we will get less then 30 stocks.

Thanks for your comments,

Ohad