Error Message:Runtime Error: In Scheduled Event 'SPY: MonthStart: SPY: 0 min after MarketOpen', Trying to retrieve an element from a collection using a key that does not exist in that collection throws a KeyError exception. To prevent the exception, ensure that the OILB WFO93GQ2HBVP key exist in the collection and/or that collection is not empty. at pandas._libs.hashtable.PyObjectHashTable.get_item File "hashtable_class_helper.pxi" in hashtable_class_helper.pxi:line 1614 KeyError : 'OILB WFO93GQ2HBVP'
Stacktrace:In Scheduled Event 'SPY: MonthStart: SPY: 0 min after MarketOpen'


I have used hist.empty to check if hist is empty, but still receiving the same error.

Do I also need to check whether or not the column 'close' is empty for spy and oil?