When I set self.DefaultOrderProperties.TimeInForce = TimeInForce.Day, none of the limit orders would be filled even if I set a very high limit price. I also tried to send market orders and it didn't work either. Basically I want the orders to be automatically cancelled before the market closes on that day if they are not filled.

#region imports

from AlgorithmImports import *

#endregion

class CryingGreenDolphin(QCAlgorithm):

    def Initialize(self):

        self.SetStartDate(2018, 12, 6)

        self.SetEndDate(2018, 12, 17)

        self.SetCash(100000)

        self.aapl = self.AddEquity("AAPL", Resolution.Daily)

        self.DefaultOrderProperties.TimeInForce = TimeInForce.Day

    def OnData(self, data: Slice):

        #self.MarketOrder(self.aapl.Symbol, 100)

        self.LimitOrder(self.aapl.Symbol, 100, data[self.aapl.Symbol].Close * 1.2)