I would like to add a consolidator for the symbols I select during Universe selection. The problem is that you have to subscribe to a symbol before you can add a consolidator for that symbol, which means (as far as I know) it can't be done inside the universe seleciton function. I attempted to add the consolidator in the OnSecuritiesChanged function but then the consolidator won't be added if no changes are made in the Universe (I am not only adding a consolidator here so it is important that this runs after every universe selection on all selected symbols even if they are already in the universe). Is there a clean way of doing this? Here is a couple of solutions I have thought off, although I am not a fan of them:

  1. Manually adding securities to my custom universe using self.AddEquity inside the universe selection function, and return no symbols from the universe selection function (so it is not added twice). Don't like this as I would need to remove the securities each day manually as well.
  2. Create a scheduled event to add a consolidator to all universe symbols after the Universe selection function has run. Kinda messy in my opinion, and the universe selection function may run at slightly different times each day.

Author