Hi QCers,

I'm on the brink of giving up trying to implement a coarse selection to my algorithm. No matter what variation of any algorithm published online I always get an empty list of symbols.

I think I have stripped the code down to the minimal example that should work, yet nothing gets printed out in my terminal.

Here is the code I'm running:

from AlgorithmImports import *

class CoarseFundamentalAlgorithm(QCAlgorithm):

    def Initialize(self):


        self.UniverseSettings.Resolution = Resolution.Daily
        self.AddUniverse(self.CoarseSelectionFunction)


    def CoarseSelectionFunction(self, coarse: List[CoarseFundamental]) -> List[Symbol]:

        sorted_by_dollar_volume = sorted(coarse, key=lambda x: x.DollarVolume, reverse=True)[:20]
        for cf in sorted_by_dollar_volume:
            self.Debug(f"{cf.EndTime} :: {cf.Symbol} : {cf.AdjustedPrice} :: {cf.DollarVolume}")

        return [ x.Symbol for x in sortedByDollarVolume]

    def OnData(self, data):
        pass

 

I am testing this live on a paper IB account using LEAN locally. Is there anything that I need to subscribe to for the coarse data? I am very confused.

Would appreciate any tips on what the heck is wrong!

Thanks!