I’m joining this discussion because our separate discussion by email seems like duplicated effort.
True as a sell rule means sell/reevaluate at each rebalance. If that’s what you want, then it suggests that you might be better served with a screen (unless you need the transaction record for some reason, like trading with IB).
I would use this as a buy rule:
(Close(0)/Close(63))-1>=(Close(0,GetSeries("SHY"))/Close(63,GetSeries("SHY")))-1
Replace the 63s with however many trading days you’d like. The trick is that SHY will only ever be the top result in your ranking system when there’s nothing else to be bought. RankPos=1 isn’t actually doing anything in portfolio/simulation as long as you’ve set the position size to 100%. (It sounds like you’d like allow immediate buyback set to yes too, but that hammers results in my test.)
I would use
(Close(0)/Close(63))-1
as the node in your ranking system. This is for two reasons: First, it makes the rule above work; there’s no guarantee that Price13W%Chg will give the same result as that formula due to rounding on the back end (as I recall, it’s dividing 251 by 4 to come up with a single quarter, and is only doing so once a week).
In fact, I can guarantee that Pr13W%Chg is going to give a different result than Close(0)/Close(63)-1, because the close formula is taking dividends into account and Pr13W%Chg is only comparing price changes.
If you want dividends to be included, then you should use TotalReturn13W, or change your ranking node to the basic formula. If you don’t want dividends to be included, then use CloseExDiv instead of Close in the basic formula.
Again, I would suggest using Close(0)/Close(63)-1 consistently everywhere.
And the more that I’ve looked at this problem, the less that I think that you’re going to get us to match ETFReplay. I’m not getting anything even remotely as high as they’re reporting.
I have no idea why, but the difference that you’re reporting in drawdowns is probably the key: If they’re reporting an 18% drawdown and we’re reporting a 45% drawdown then we’ve selected different ETFs in 2008/2009.