Hi all,
I would like to ask for thoughts / feedback from the community on how to implement the idea below. I think I found a way but I wonder if there might be something simpler that I am not seeing. Thank you in advance…
I am testing the idea of using the relative perf of ETFs vs one another to inform me on the current market regime. For example value (IWD) vs growth (IWF) etc.
Then I would dynamically switch on/off nodes in a ranking system and / or switch on / off buy and sell rules in a stock portfolio (please note → not an ETF portfolio)
I am aware that there are other ways to test value vs growth w/o using ETFs but I specifically want to use ETFs and not just those two!
I have the ranking that measures the relative perf → call it “RankETF”. It is also easy to do a screen that only select the top ETF, or is only invested if the top ETF is IWD using the ranking system “RankETF”.
Weaving that into a stock port seems more complicated → I cannot call screen() from a port. Nor can I use portfolio(id) for an stock port to check for the presence of an ETF in an ETF port. I have not yet tried to weave this into a ranking.
My proposed solution (not tested yet):
-
Create an ETF Universe that will articulate the ranking “RankETF” using a bunch of setvar(@MyRank,forder(,)) or setvar(@Rk,frank(,)) as rules
-
Assuming I want to know if value is doing great → make this Universe output either nothing or IWD if it is the top ETF for the ranking “RankETF” using the rule → ticker(“IWD”) & @MyRank =1. Note that I use Forder for @MyRank
-
Create a custom series that counts the # of positions in my ETF universe (0 or 1). If there is one position, it has to be IWD meaning that value is doing well.
[NB: I remember I had trouble in the past using univcnt() with a zero-sized universe. I did report it on the forum at the time but do not remember if it has been fixed] -
then call my custom series in the ranking or stock portfolio as needed to switch on/off nodes and / or buy or sell rules.
Thoughts appreciated.
Thank you in advance
Jerome