Hi,
I'm currently trying to build an universe based on this screener from yahoo finance. Currently I got this code:
def CoarseSelectionFunction(self, coarse):
filtered = [ x.Symbol for x in coarse if x.HasFundamentalData and x.Price > 5]
return filtered
def FineSelectionFunction(self, fine):
stocks = [ x for x in fine if x.AssetClassification.MorningstarSectorCode == MorningstarSectorCode.Technology and ((x.SecurityReference.ExchangeId == "NYS") or (x.SecurityReference.ExchangeId == "NAS") or (x.SecurityReference.ExchangeId == "ASE"))]
return [x.Symbol for x in sorted(stocks, key=lambda s: s.EarningReports.BasicAverageShares.ThreeMonths * s.Price, reverse=True)[:20]]
But it's just not working as expected (the selected symbols are not the same).
Would be great if anyone could give a hint on what I'm missing