The following code, identical to the solution, does not pass a Submit. Error given: “Looks like you didn't set the expiry filter for contracts expiring within 90 days...”. Would have sent to support, but the Send Support button didn't work. 

  1. class BootCampTask(QCAlgorithm):
  2. def Initialize(self):
  3. self.SetStartDate(2013, 12, 20)
  4. self.SetEndDate(2014, 2, 20)
  5. self.SetCash(1000000)
  6. #1. Request Gold futures and save the gold security
  7. self.gold = self.AddFuture(Futures.Metals.Gold)
  8. #2. Set our expiry filter to return all contracts expiring within 90 days
  9. self.gold.SetFilter(0, 90)

Author

Michael Rand

July 2022