Different results for same Buy rule

P123 Team,
Can somebody please explain why the two simulations show different performance when they have the same buy rule, just written in a different way. The buy rules are the names of the sims. The sell rule is “1”.

One of the sims currently holds IEF, while the other one is in SPY.


I don’t think the first version is doing what you intended. It will always be able to buy IEF (since IEF is never [font=courier new]Ticker(“SPY”)[/font]) but will only occasionally always be able to buy SPY (since SPY is only sometimes held by the 1451475). When 1451475 is holding SPY, [font=courier new]$port1>0[/font] will be true when running the rule on SPY and false when running the rule on IEF. That means the backtest results would be affected by whatever ranking system is selected.

Aaron, thank you for the explanation. I could not figure out why it was holding IEF, when the underlying Portfolio(1451475) was holding SPY. However, there is no ranking system involved and the results are puzzling. I can only conclude that my “No Rank” ranking system is not really no rank. Could you post the rules for a no rank system please.

Yes, the second sim with FSum is the correct one, matching Portfolio(1451475) which switched to IEF on Mar-9, unfortunately a bit late. No market timing model can catch black swans like this.

The only value of a ‘No Rank’ ranking system is that it is computationally cheaper to assign ranks. There must always be an order, though, so a ‘No Rank’ ranking system should be assumed to have an undefined, deterministic order. In the end, a system evaluates equities in the order assigned by the ranking system until the system is ‘fully invested’.
How would you expect a ‘No Rank’ ranking system to behave other than its current behavior?

Aaron, for some ETF strategies you don’t need a ranking system, only buy and sell rules.

My “No-Rank” ranking system works just fine, except for the case discussed above.
This is what I use:

1

As you can see there is no Formula and also no Formula Weight.
That’s why I was surprised at the results of the first sim.