I'm currently using:

    def on_data(self, slice):
        if self.is_warming_up:
            return
        if any([not slice.contains_key(s)for s in self.active_securities.keys if self.active_securities[s].price > 0 ]):
            return

But that seems very inefficient because “on_data" will be called for every security, and every time I have to check whether all securities are ready. That's O(n^2) time complexity.

 Is there a better way to do this?