I am trying to build an algorithm that buys the top 6 gaining stocks at the beginning of stock day and sell it with stop limit trailing order of 1% if it reaches above 5%. I get the below exemption when running backtest.

 

QuantConnect.Scheduling.ScheduledEventException: In Scheduled Event 'SPY: EveryDay: Every 1 min', ---> System.Exception: AttributeError : 'NoneType' object has no attribute 'Close'
at sellAfter5prcnt in main.py:line 95 :: currentPrice = self.CurrentSlice[symbol].Close
---> Python.Runtime.PythonException: AttributeError : 'NoneType' object has no attribute 'Close'
at Python.Runtime.PyObject.Invoke (Python.Runtime.PyObject[] args) [0x00035] in :0
at QuantConnect.Scheduling.ScheduleManager+<>c__DisplayClass15_0.b__0 (System.String name, System.DateTime time) [0x00011] in :0
at QuantConnect.Scheduling.ScheduledEvent.OnEventFired (System.DateTime triggerTime) [0x00027] in :0
--- End of inner exception stack trace ---
--- End of inner exception stack trace --