RollSchedule#

class sigtech.framework.schedules.roll_schedules.factory.RollSchedule

Class responsible for calculation of a rolling table.

Available roll tables:

  • 'front' - Front contract, contract month with an expiration date closest to the current date.

  • 'f_0' - Adjusted front contract (typically 3 months out).

  • 'f_1' - First contract after 'f_0'.

  • 'f_2' - Second contract after 'f_0'.

  • 'f_3' - Third contract after 'f_0'.

  • 'f_4' - Fourth contract after 'f_0'.

  • 'f_4_5' - Blend of fourth and fifth contract after 'f_0', applicable only to metals.

  • 'f_5' - Fifth contract after 'f_0'.

  • 'f_6' - Sixth contract after 'f_0'.

  • 'f_near' - Nearest contract, used for roll yield calculation (unlikely to be tradable).

  • 'bcom' - Bloomberg Commodity Index roll schedule.

  • 'bcom_3m' - 3 month lead on Bloomberg Commodity Index contract schedule.

  • 'dec' - December contract at least 6 months in the future.

  • 'djubs' - Dow Jones-UBS commodity index roll schedule.

  • 'energy' - Proprietary schedule for energy contracts.

  • 'energy_obs' - Signal observation schedule used to trade the energy contract schedule.

  • 'gsci' - GSCI (Goldman Sachs) Single Commodity Indices contract schedule.

  • 'gsci_eom'

  • 'long_carry' - Proprietary schedule used for commodity long carry strategy.

  • 'short_carry' - Proprietary schedule used for commodity short carry strategy.

  • 'mcq_long_carry' - Macquarie schedule used for commodity long carry strategy.

  • 'mcq_short_carry' - Macquarie schedule used for commodity short carry strategy.

  • 'prev_month' - Roll the front contract the month before the expiration date.

  • 'rici' - Rogers International Commodity Index (RICI) contract schedule.

  • 'seasonal' - Contract schedule based on harvest date (agriculture and grains).

  • 'seasonal_obs' - Signal observation schedule used to trade the seasonal contract schedule.

  • 'front_oi' - Front contract, shifted to start roll when open interest is greater on contract to roll in.

  • 'f_0_oi' - Adjusted front contract, shifted to roll when open interest is greater on contract to roll in.

  • 'quarterly'

  • 'tri'

  • 'pre_roll'

calculate_rolling_table()

Calculate the rolling table using the appropriate rolling method.

Returns

pandas DataFrame.

static get_first_contract_with_data(roll_table)

Scan the roll table and return the first contract with no subsequent empty or invalid contracts.

Parameters

roll_table – Input roll table.

Returns

Contract object.