Hi Everyone,

I am working on a multi-universe algorithm, and have a few general questions

For background, I am using two universes, created in Initialize() as below

# Built-in QuantConnect Universe
self.AddUniverseSelection(QC500UniverseSelectionModel())


# User-Defined Universe in a Seperate File
self.AddUniverseSelection(SimpleUniverseSelectionModel())

 

My questions are as follows

  1. What exactly are the differences between the AddUniverse() and AddUniverseSelection() functions? My understanding is that AddUniverse() returns a reference while AddUniverseSelection() does not, and that AddUniverse() takes a filter function while AddUniverseSelection() takes an object.
  2. If my above understanding is correct, what is the best way to differentiate between universes created by AddUniverseSelection()?

 

Specifically, I can loop through my algorithm's universes with something like

for universe in self.UniverseManager.Values:
	...

 

But I run into issues because 

  1. There is no way to store a reference to individual universes when creating them with AddUniverseSelection(), as there is with AddUniverse().
  2. There is no way to pass a 'name" to individual universes when creating them with AddUniverseSelection(), as there is with AddUniverse().
  3. The engine-assigned “names” are not meaningful. In my example, my two universe names are “QC-UNIVERSE-COARSE-USA-E8C0F56F-59C1-4B5D-9310-2D2BB0ECF4FD”, and “QC-UNIVERSE-COARSE-USA-630CF869-A81F-4E22-A673-D825D9986EE9”, which are not particularly helpful.

 

In my case, I am able to differentiate between my two universes by using the UserDefinedUniverse keyword, since it happens that I created one of my universes, and Quant Connect created the other

for universe in self.UniverseManager.Values:
	if universe is not UserDefinedUniverse:
    	qc500 = universe

 

But, if this were not the case, how would I go about solving this problem.

 

Thanks!