Backtestingtesting BUY/SELL ratio cutoffs within top ranked stocks only

I would like to test a BUY/SELL rule in a simulation using a ratio.

For example, what is the optimal cutoff for a ratio in a rule such as FRank(“EarnYield”) > nn?

To do this, I would like to create a ranking system backtest with this ratio on the top ranked stocks in the same universe that the simulation is based on.

Is there a way?

What did I try?

  1. I tried creating a new custom universe with the same rules as the sim’s universe + the other buy rules of the sim + RatingPos(“My Rank”) > 90. I got “ERROR: Cannot use Rating function in custom universes”

  2. I also tried creating a RankPos within a ranking system. That didn’t work.

Any ideas?

FRank woks in custom universes. Have you tried that?

Yes, thanks. FRank(“”) works well for a single factor. The issue comes up with multi factor ranking systems.

I’m not sure I understand what you’re trying to do, but I have referenced a separate screen as a screen criteria. For example

Rank > 80 //use only top 20% of ranking system
Rating(“EarnYieldScreen”) > 90 //must be in top 10 percentile of this screen.

I think you could adjust the rules (edit: and ranking system) in screen “EarnYieldScreen” to adjust for optimal level of earning yield and rerun sim with various options.

I’m not sure if that’s what you’re trying to do, but maybe?

It’s a very common scenario that many of us grappled with at one time or another.

Lets say you have a portfolio that buys the top ranked stocks (Rank>90). You wonder if a buy (or sell) rule will improve things.

If the buy rule is a yes/no formula for example !StaleStmt, then it’s easier–you can test it in a screen; comparing the results of !StaleStmt vs StaleStmt.

But if the rule is based on a ratio like EarnYield > nn, you really don’t know what the optimal number is for nn, right? So what do you do?
(a) You can try a bunch of different numbers via trial and error, and end up with a curve fitted number.
(b) Alternatively, you can pick a number that is roughly in the ballpark and not test any other numbers.
(c) However, to truly get a sense of the optimal nn number, I would run a ranking system on stocks that pass the other rules of the sim; which includes Rank > 90. Then you should see clearly if there was a pattern.

Hi Chipper, sorry for my confusion. I woke up today and realized I was wrong in my initial discussion above. Rating() is for rating systems, not screens as I described above, but I think I have used it in the way you describe.

For instance, you can setup a ranking system for several earnings yield factors, like current ttm earnings yield, 3 yr avg earning yield, forward estimated earnings yield, etc. and then reference that ranking system as a rule in your Screen. This lets you utilize two ranking systems simulataneously. (Rating can be used on up to 3 simulataneous ranking systems in this way)

So could have a screen for sim with rules:

Rank > 90 //uses main ranking system
Rating(“EarningsYieldRankSys”)>50 //uses ranking system that specifically targets earning yeild threshold

I think this would allow interrogation as you describe, but I’m not sure. I apologize for my error above.

edit: fwiw, I also use
Screen(“Screen Name”,30)
in a similar way to restrict or combine results across various screens.

I am not sure what you mean.

How would you run a ranking system on a screen?

Here’s an example I use:

“Ranking System A” that is a kitchen sink (lots of diverse factors) ranking model
“Ranking System B” that is simply 3 measures of short interest.

Rules for the screen which is based on Ranking System A are:
Rank > 95 //This is determined by Ranking System A
Rating(“Ranking System B”) > 50 //restricts results only to companies in the universe that rate highly on Ranking System B with short interest factors.

Ranking System B, in this case, could be changed to represent a suite of earnings yield value factors or other combinations you’d like to isolate/vary.

Not sure if this helps, but hope it’s of some use.

Thanks.

I am after something more powerful. I want to get a chart of rank vs returns for the ratio under consideration. Perhaps by running a ranking system backtest on a universe limited to the top ranked stocks and showing the buckets.

I don’t think it’s possible currently. Unless someone has an idea?