Dear QuantConnect team,

I have been experimenting with SPX options and I'm currently facing a number of issues.
To simplify debugging i have attached a streamlined version of the backtesting script.
Here is what I noticed:
1) I'm using the setFilter to subset the option chains within a given DTE. If I'm looking at zero DTE, no chains/contracts are returned.

# One week in January 2021. SPX trades Monday, Wednesday, Friday. 
self.SetStartDate(2021, 1, 11)
self.SetEndDate(2021, 1, 15)
# Using Days to Expiration
self.dte = 0

With the above parameters I would expect the chain to be available three times (Mon, Wed, Fri) during the backtesting period, however no chains are returned by the filter method.

Log:
2021-01-11 09:55:00 : Entering method openPosition
2021-01-11 09:55:00 : -> No chains!
2021-01-12 09:55:00 : Entering method openPosition
2021-01-12 09:55:00 : -> No chains!
2021-01-13 09:55:00 : Entering method openPosition
2021-01-13 09:55:00 : -> No chains!
2021-01-14 09:55:00 : Entering method openPosition
2021-01-14 09:55:00 : -> No chains!
2021-01-15 09:55:00 : Entering method openPosition
2021-01-15 09:55:00 : -> No chains!

Setting self.dte = 1 also produces no results.

2) Setting self.dte >= 3, I can see a chain being returned, however when submitting a MarketOrder to sell I get a warning that the order was filled at a stale price based on the previous day price

# Using Days to Expiration
self.dte = 5

Log:
2021-01-11 09:55:00 : Entering method openPosition
2021-01-11 09:55:00 : -> No chains!
2021-01-12 09:55:00 : Entering method openPosition
2021-01-12 09:55:00 : -> Found 346 contracts in the option chain!
2021-01-12 09:55:00 : Time: 01/12/2021 14:55:00 OrderID: 1 EventID: 1 Symbol: SPX 210115P05400000 Status: Submitted Quantity: -1 IsAssignment: False
2021-01-12 09:55:00 : Time: 01/12/2021 14:55:00 OrderID: 1 EventID: 2 Symbol: SPX 210115P05400000 Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 1598.5 USD OrderFee: 1 USD Message: Warning: fill at stale price (01/11/2021 15:20:00 America/Chicago) IsAssignment: False
2021-01-13 09:55:00 : Entering method openPosition
2021-01-13 09:55:00 : -> Found 345 contracts in the option chain!
2021-01-14 09:55:00 : Entering method openPosition
2021-01-14 09:55:00 : -> Found 334 contracts in the option chain!
2021-01-15 09:55:00 : Entering method openPosition
2021-01-15 09:55:00 : -> Found 1 contracts in the option chain!


I must be missing something, can you please advise?
 

Author