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.