Is several Sector Optimization Possible in one simualtion?

Let's say I've created what amounts to a global universe and then divided it into 12 sector sub-universes, and I have optimized a rankingsystem to each sector using a Genetic Algorithm and CMA-ES.

Is it possible to achieve a solution in the simulation where, when it needs to select a stock from a sector, it automatically chooses the optimized ranking system as well? Or are there other methods for how I can utilize this sector optimization that is located in several different ranking systems?

There's a limit to the number of different ranking systems you can use in one simulation (not sure what the limit is). But the language in the buy rules is easy: (Sector=Financial) * Rating("[name of ranking system]") + (Sector=Tech) * Rating ("[name of ranking system]") etc and then specify a threshold (e.g. > 99.5). You can also use RatingPos if you prefer and then your threshold would be < 6 or whatever.

1 Like

Hi @yuvaltaylor , thanks for sharing. Is this a way to require a stock to be ranked well in multiple ranking systems? I will be trying this out!

Thanks for sharing but it does not work for me or I did it wrong.
If we want to select top 10 stocks from each sector (tech and financials) based on two separate ranking systems, then this formula does not work for me:

(Sector=tech) * RatingPos("r1")+(Sector=financial) * RatingPos("r2") <= 10

It may fail, and select only 1 stock from financials because we operate on the same universe.

I was thinking that this formula below would work but actually FOrder does not handle RatingPos().

(Sector=tech) *FOrder(RatingPos("r1") #sector) + (Sector=financial) *FOrder(RatingPos("r2") #sector)

Any thoughts ?

Yes, I apologize, I did get it wrong. You have to use Rating, not RatingPos. And it's not going to reproduce the exact same ranking as you would have gotten if you'd used it on the sector alone. The best way to deal with that is to change all the nodes in your sector-specific ranking systems to use "sector" instead of "universe." I use FOrder in combination with RankPos all the time; are you sure it doesn't work with RatingPos? Did you use nested quotations?

It seems like other rank does not work with FOrder:

This works but only in Screener:

@r1: RatingPos("Core: Low Volatility") 
Forder("@r1", #sector)<=10

Mu current approach is to use conditional node in ranking system

And this buy rule in simulation:
SecWeight < 51

But this design works worse performance-wise than having two separate simulation with distinct universes and ranking systems.