I have an alpha model that implements OnSecuritiesChanged to maintain a symbolData dictionary. I am noticing that if I run a backtest that has a scheduled universe selection to add AAPL, across 9/1/2014 and 9/2/2014 I get two different symbols that act "kinda" the same:

AAPL R735QTJ8XC9X is added for 9/1/14

AAPL is added for 9/2/14

On 9/2/14 I receive a call to OnSecuritiesChanged to add AAPL, but the former symbol AAPL R735QTJ8XC9X is not removed. From the point of view of dictionary keys, however, both symbols act the same, so on 9/2 the symbolData management code sees AAPL as already being in the dictionary and doesn't add it again.

However, apparently this means that I'm still subscribed to two different symbols. I also have an OnEndOfDay event handler and I'm noticing that it gets called twice for AAPL. I am inferring that this is the result of being subscribed to two different symbols under the hood. 

Am I doing something wrong here? So far everything seems to work as long as I make the OnEndOfDay handler idempotent for being called multiple times with the same symbol, but I'm worried something else may break.

Author