is it possible to have a rank (example : highest Price )
and then sort or Rank that universe by a secondary rank ( example :
lowest PE ) to then be used in a Portfolio Simulation ?
Each Rank must be independant, not combined into one rank.
The first Rank and then the second Rank must be able to walk forward rather than creating a universe that remains fixed to a specific date.
For simple factors or functions can use FOrder. Use FOrder of price in the first rule the you can rank those with FOrder of PE ratio in the next rule using. #previous. Will write out formally on computer if need later (oniPhone).
Another approach is to use the Rating(“Your ranking system name here”) function. First create a new ranking system with the function or functions. This can be any existing ranking system you have or a P123 system. You can run a Sim using one ranking system, and then add the Rating(“”) function to the buy rules. You can use up to 2 Rating(“”) functions in the Sim buy rules.
Denny,
tried adding a ranking system into the body of buy rules,
but has no effect on results. whatever rank system I add,
results do not change. even when adding a rank for shorting (inverse ranking rules), simulation performs exactly as if the second rank does not exist. i get no errors…sim backtests ok.
Jim,
adding Rank into body of buy rules seems to work for
SOME of my Personal Ranking Systems, but will not recognize all.
All personal ranking systems work properly when used as a rank, yet when added as a rule,
some work, yet others generate an error message.
why would some ranking systems be accepted as a rule, while others are rejected ?
thanks for your help.
thanks to all providing help with rank within body of buy rules.
the error message is no longer…when I renamed the Ranking Systems and then placed it within Rating(“rank name”)> x.
now all i need to do…is figure out what rank within buy rule is really doing? just giving me a new, restricted universe of stocks based upon (rank name) > 80 , or can it sort from highest rank value to lowest rank value… so lower values can be eliminated prior to “Final” rank system ? did that make any sense ???
You ask an important question about the ordering of operations. If you want to select the highest ranked stocks by a ranking system and then want to rank only those stocks (using a different ranking system), then you would use FOrder on the universe then perform a second FOrder on those stocks selected by the first FOrder operation. Turns out that, done in proper sequence, the rating and ranking that Denny described gives you the exact same result if you are rating and ranking with single factors (in each ranking system). But it is possible that it would not give you the same result if you were able to use multiple factors in FOrder.
Rating and Ranking both perform their operation on the entire universe. If you are rating and ranking multiple factors you can get results that seem counterintuitive. For single factor ranking one just needs to know which rank is being performed first.
Rating (the rating in the buy rules) is done first then you get the highest rank of those in a port or sim using its ranking system.
I hope your post generates a little discussion that may correct any false impressions I may have on this.
I am trying to do a multifactor rank of a multifactor rank and am not sure how to control the top results that I ultimately want to buy. My universe has ~3000 stocks.
To begin, I want to use the top 20% of my first rank (called ‘EE’)
should I be referencing ‘EE’ as my ranking system in the simulator?
How do I specify the top 20% for the ‘EE’ rank? Do I have a Buy rule of Rank>80?
I then want to rank the results of ‘EE’ by another rank, called ‘valuation’, and take the top 10% of ‘valuation’
Is my other Buy rule called Rating(“valuation”)>90? Does the Rating rule only operate on the results from the ‘EE’ rank (600 stocks) or on my whole Universe of 3000? I just want the 600 to be ranked by ‘valuation’.
I ultimately want the 10 best (in the top 20% of ‘EE’ and then from the top 10 of ‘valuation’)