Is this a valid BUY rule?

Aaron, please advise whether this is a valid buy rule.

Eval(ticker(“SPY”) & Portfolio(1451475,1522144,1508876,1416460),ticker(“SPY”),ticker(“UST”))

alternatively: ticker(“SPY”) & Portfolio(1451475,1522144,1508876,1416460) | ticker(“UST”)

The way I understand it is that “Portfolio” checks the four live strategies listed and returns true when it finds “SPY” in any of the four portfolios, but they don’t have to hold SPY simultaneously. For periods when SPY is not held in any of the four ports it buys UST.

It looks like it would do what you explained.

But you are not quite sure ?

Yes. It will do what you said.

Aaron, please advise on the order of weekly automatic rebalancing.

The way I understand it is that Live Strategy models are rebalanced first. Is the order of rebalancing according to port IDs? i.e. Lowest ID is rebalanced first and highest ID last? Or is it happening randomly since you are using different servers?

Then after all Live Strategy models have been rebalanced the Live Books get done.

Now what happens when one has a a buy rule in a Live Strategy model “A” that has an ID that is lower than any one of the four models listed in the buy rule:
ticker(“SPY”) & Portfolio(1451475,1522144,1508876,1416460)

Would that then evaluate using the holdings from last week in those four models? This would be the logical conclusion if rebalancing is according to port IDs, with lowest ID being the first to be rebalanced. But perhaps it’s the other way round, if highest IDs are rebalanced first then it would produce the correct result under the assumption that model “A” has a lower ID than the models in the buy rule. So this needs to be cleared up.

In order to ensure that the updated holdings of the four models are being used they have to be rebalanced before Live Strategy model “A” is reconstituted. That may require a setting in model “A” which tells the servers to rebalance this model last, but before the live books are done. But as a minimum I need to know whether rebalancing is rule based and is done consistently according to those rules, and what those rules are.

Also, I seem to remember having read that DMs are being done first. If that is true, then this buy rule would incorrectly reference the previous weeks holdings in those four models and give the wrong results in the DM.

Thank you.

Automatic rebalance is done in three stages: Designer Models, Strategies, then Books. Models are ordered by name.
If you intend to use this rule in a designer model, you will either need to accept the 1-week lag or manually rebalance the referenced models during the weekend.

Thank you Aaron for the explanation. I did not know that Models are ordered by name.

Sorry but since we are at it, can we clarify the order of rebalancing for Strategies (in what is now called Research)?

From a prior thread a couple of years ago, it was per Port ID? Is that still the case?

Many thanks

Jerome

Aaron,
I suggest that the Function Reference “Portfolio” is updated accordingly, with an explanation that referenced strategies have to be rebalanced first, otherwise you get 1 week delayed information. Therefore referenced models should have names which are alphabetically higher than the model in which they occur, because models are ordered by name.

Otherwise, P123 could also consider providing a tick box in the rebalancing module to ensure that these referenced models get rebalanced first. Perhaps for a few Dollars a month to pay for the privilege.

P123

I am also curious about the answer to Jerome’s question. It was toldo us that the order of rebalancing was by PortID from low IDs (old) to higher IDs (newer).

Please clarify as some of my models are based on this assumption.

Thanks
Whotookmynickname

Aaron please cofirme that models are rebalanced in the order of their names (alphabetically, presumably “A” is first) and not according to their ID number.

Thanks

Verified:

  1. All Designer Models are rebalanced, alphabetical order A-Z, case insensitive.
  2. All Strategies are rebalanced, alphabetical order A-Z, case insensitive.
  3. All Books are rebalanced, alphabetical order A-Z, case insensitive.

In practice, anything that is then done manually could be considered as a step four.

This came as a surprise to me too. :slight_smile:

Paul, thanks a lot.
Good to know; this clears up confusion that existed among us.

Thank you indeed Paul!

Can I suggest adding that in the help / Factor Reference for the function portfolio()

Jerome

Please update the Factor & Function Reference w/ the implicit portfolio evaluation order rules.

Walter

EDIT: Jerome, you beat me to the request!

Thanks for the reference update! Looks good.