I can't attach the backtest (probbably because it returns an error), so I am posting the code:

class SwimmingFluorescentYellowAlligator(QCAlgorithm):

    def Initialize(self):
        self.SetStartDate(2015, 1, 1)
        self.SetEndDate(2015, 1, 7)
        self.SetCash(100000)  # Set Strategy Cash
        self.AddEquity("ROST", Resolution.Minute)

    def OnData(self, data: Slice):
        '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
            Arguments:
                data: Slice object keyed by symbol containing the stock data
        '''

        if not self.Portfolio.Invested:
            self.SetHoldings("ROST", -1)
        self.Debug(self.Portfolio["ROST"].IsShort)

This returns an error:

Runtime Error: Trying to dynamically access a method that does not exist throws a TypeError exception. To prevent the exception, ensure each parameter type matches those required by the 'bool'>) method. Please checkout the API documentation.
at OnData
self.Debug(self.Portfolio["ROST"].IsShort)
===
at Python.Runtime.PyObject.Invoke(PyTuple args in main.py: line 17 (Open Stacktrace)

Author