next_imm#

rateslib.scheduling.next_imm(start, definition=<rl.Imm.Wed3_HMUZ>)#

Return the next IMM date after the given start date.

Parameters:
  • start (datetime) – The date from which to determine the next IMM.

  • definition (Imm, str) – The IMM definition to return the date for. This is entered as either an Imm enum, or that enum variant name as sting, e.g. “Wed3”.

Return type:

datetime

Examples

Get the next quarterly SOFR or ESTR futures date, defined by CME, EUREX, or ICE:

In [1]: next_imm(dt(2000, 1, 1), Imm.Wed3_HMUZ)
Out[1]: datetime.datetime(2000, 3, 15, 0, 0)

Get the next serial futures contract for a NZD bank bill defined by ASX:

In [2]: next_imm(dt(2000, 1, 1), "Wed1_Post9")
Out[2]: datetime.datetime(2000, 1, 12, 0, 0)