Let's say I want to automatically liquidate my position x minutes after it is placed, how would I do that?

My current line in OnOrderEvent method is not working

if (self.Time == (data.marketTicket.Time + timedelta(minutes = 5)):
                    marketTicket2 = data.Liquidate(symbol)