Add dte column to dataframe of futures contract prices. Here, dte refers to calendar days to expiry

days_to_expiry(contracts)

Arguments

contracts

dataframe of futures contract with at least ticker/date fields. date must be a date object.

Value

dataframe of futures contracts with date/dte fields