Hi folks. Relative novice here, thanks in advance for the help. Using scheduled events I got the following error:

"BacktestingRealTimeHandler.Run(): There was an error in a scheduled event SPY: EveryDay: SPY: 10 min after MarketOpen. The error was NameError : name 'design' is not defined"

Here is the relevant snipped of code. The first scheduled event runs without error (confirmed by debug line). Happy to paste in more code if needed.

def Initialize(self):

# Assign various variables

self.Schedule.On(self.DateRules.EveryDay('SPY'), self.TimeRules.At(0, 15), Action(self.ScheduleEndOfMonthRebalance))
self.Schedule.On(self.DateRules.EveryDay('SPY'), self.TimeRules.AfterMarketOpen('SPY', 10), Action(self.rebalance))
self.Schedule.On(self.DateRules.EveryDay('SPY'), self.TimeRules.BeforeMarketClose('SPY', 15), Action(self.sellout))