Hopefully this is just a mistake on my part but I’ve been running into problems on a weekly sim with the following sell rule:
NoDays > 365 & Rank < 101
Intention is to hold the target stocks for a year and then rebalance (I plan to add timing rules as well to exit the market under certain conditions but haven’t put any of those on yet). Unfortunately when I run the sim it sells all the stocks at the first weekly rebalance (doesn’t seem like the NoDays rule is working at all). Any ideas?
As Florian noted, if Rank returns NA funny things happen.
The ‘<’ test returns NA which makes sense. But NA anded with NA, True or False returns 0 (i.e. False).
It’s a bit surprising that
True & NA
returns 0 (i.e. False). I was expecting NA. Of course, that just delays the question of whether NA should be considered True or False within the Sell rules.
Walter
EDIT: Rank returning NA doesn’t seem to the root cause of the problem described in the OP.
Hi Marco - thanks for looking into it - for whatever reason when I tried to put the sim back and reproduce the problem tonight I couldn’t. So may have just been an error on my part - I’ll let you know if I run into it again.
Florian, Walter interesting point on the merger / NA detail - I don’t think that was a factor in my case but good thing to keep in mind.
I guess that’s another reason to exclude the (mostly) redundant Rank < 101 as Paul points out.