In [ ]:
class MyAlgo(QCAlgorithm):
    def Initialize(self):
    # Reference to AAPL
        self.SetStartDate(2017,10,2)
        self.SetEndDate(2017,10,6)
        self.SetCash(1000)
        self.secs = ["AAPL", "IBM", "CAT"]
        for stock in self.secs:
            self.stock = self.AddEquity(stock)
        self.Log("hello")
        self.secs_df = pd.DataFrame(index=self.secs)

    def OnData(self, data):
        ''' Runs every tick defined by resolution in initialize under equity'''
        # Position 100% of our portfolio to be long in AAPL
        len_sec = len(self.secs_df)
        self.Log("total securities to trade" + str(len_sec))
        for stock in self.secs_df:
            self.SetHoldings(stock, 1/len_sec)
            #self.SetHoldings("IBM", 0.5)
        # self.Log(ammount of stocks owned of each secutrity)