I am trying to find a way to test a program on hundreds of different stocks, specifically the 500 in the SPY or the 500 in the QC500 stocks. Problem is, I've tried everything I can to use these but nothing works. 

 

Here is my code I am trying to run:

 

from AlgorithmImports import *
# endregion

from Selection.FundamentalUniverseSelectionModel import FundamentalUniverseSelectionModel
from itertools import groupby
from math import ceil
from QuantConnect.DataSource import *


class SwimmingYellowGreenKitten(QCAlgorithm):

    filteredByPrice = None
    coarse = None

    def Initialize(self):
        # Set the start date to June 2021 and the cash to 100000.
        self.SetStartDate(2021, 6, 1)
        self.SetEndDate(2023, 6, 1)
        self.SetCash(100000)

       # qcDataStuff = qcData.QC500

        #self.Universe = self.SetUniverseSelection(QCAlgorithm)
        
        
# all this stuff is attempts to import 500 stocks/use them

       
       # self.Universe = self.SetUniverseSelection( QC500UniverseSelectionModel() )
        #self.AddUniverse(self.Universe.QC500)
        #self.Debug("universe 1 unused is " + JSON.stringify(self.Universe.QC500))
        #self.Universe = "SPY"
        #self.Universe = QC500UniverseSelectionModel()

        #self.AddUniverse(self.CoarseSelectionFilter)
        #self.AddData(QCData.QC500)



        self.daily_returns = {}
        self.consecutive_increases = {}
        


    def OnData(self, data: Slice):
        # Loop through all the symbols in the stock "universe"?
        self.Debug("data received")

        for symbol in self.Universe:
            if symbol not in self.daily_returns:
                self.daily_returns[symbol] = [0]
            if symbol not in self.consecutive_increases:
                self.consecutive_increases[symbol] = 0

            close = data[symbol].Close
            
            
# ETC, do stuff with the data

 

Basically, I can't figure out how to add and use the 500 stocks no matter what I try. I'm out of ideas. Any help or ways to do this would be amazing.