sthoooon
12/12/2017 - 3:08 PM

Manually Selecting Data

The self.AddEquity() method is used for manually requesting assets. It takes a string ticker of the current asset name and the resolution.

The AddEquity (and all other AddAsset methods) return a security object. This gives you a reference to the security object you can use later.

You can control the resolution of the data with the Resolution enum. It has the values Tick, Second, Minute, Hour and Daily. e.g. Resolution.Minute. Not all data is available in all resolutions.

class BootCampTask(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2017, 06, 01)
        self.SetEndDate(2017, 06, 15)
        
        # Manually Select Data     
        self.spy = self.AddEquity("SPY", Resolution.Minute)
        self.iwm = self.AddEquity("IWM", Resolution.Minute)
        
    def OnData(self, data):
        pass