Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# self.options_expiry_to_datetime_date

strategies.strategy.Strategy.options_expiry_to_datetime_date(self, date)

  Converts an IB Options expiry to datetime.date.

  Parameters:

    date (str) – String in the format of ‘YYYYMMDD’

  Return type:

    datetime.date

  Example

      >>> # Will return the date for the expiry
      >>> date = "20200101"
      >>> expiry_date = self.options_expiry_to_datetime_date(date)
      >>> self.log_message(f"Expiry date for {date} is {expiry_date}")