Instruments#

Cash

Cash object representing an instrument that is always worth 1 in a given currency.

CashIndex

A class implementing a cash asset based on interest rate fix instrument, e.g.

DefaultUniverses

Access the default universes of returns series for quick assessment of signal potential.

Margin

Margin object representing an instrument that is always worth 1 in a given currency.

TotalReturnSwap

Class implementing a total return swap on a given underlyer.

TradableCSVIndex

A class implementing a tradable wrapper over an index to load from a CSV file.

TradableIndex

A class implementing a tradable wrapper over an index.

TradableTSIndex

A class implementing a tradable wrapper over a timeseries.

IntradayInstrument

A class implementing a tradable wrapper over an index with ability to generate intraday orders.

sigtech.framework.instruments.utils.expiry_date_calculated(contract_month, contract_year, expiry_day, expiry_month_offset: int, expiry_week_n: int, expiry_adjust_by_cd: int, expiry_bdc: str, expiry_adjust_start: bool, expiry_offset: str, holiday_calendar: str, expiry_adjust_start_bdc: Optional[str] = 'PREVIOUS') datetime.date

Calculates the expiry date of a contract given its month, year and other inputs.

Parameters
  • contract_month – Index of contract month (1 ... 12).

  • contract_year – Contract year.

  • expiry_day – Either a calendar day number, an English weekday or 'EOM'. Defines the reference point for later adjustments.

  • expiry_month_offset – Number of months to offset the reference date from the contract/delivery month.

  • expiry_week_n – Which instance of the given weekday to start the reference date from. (E.g. 3rd Wednesday) Must be non-zero for expiry_adjust_by_cd to take effect. Can be -1 (-2), in which case the last (second to last) weekday will be picked.

  • expiry_adjust_by_cd – Number of calendar days to adjust reference date by.

  • expiry_bdc – Business day convention to use for final adjustment, i.e. 'FOLLOWING', 'MOD_FOL', 'PRECEDE', 'MOD_PRE', 'NONE_RULE'

  • expiry_adjust_start – Whether to adjust the reference date to fall on a business day.

  • expiry_offset – Final adjustment to reference date. (E.g. '2BD' or '-3D')

  • holiday_calendar – Calendar string identifier.

  • expiry_adjust_start_bdc – Business day convention to use for adjustment of reference date (either 'PREVIOUS' or 'FOLLOWING').

Returns

Calculated expiry date.

sigtech.framework.instruments.utils.expiry_date_calculated_from_ticker(ticker, expiry_day, expiry_month_offset: int, expiry_week_n: int, expiry_adjust_by_cd: int, expiry_bdc: str, expiry_adjust_start: bool, expiry_offset: str, holiday_calendar: str, expiry_adjust_start_bdc: Optional[str] = 'PREVIOUS') datetime.date

Calculates the expiry date from a given ticker and inputs.

Parameters
  • ticker – Ticker of contract.

  • expiry_day – Either a calendar day number, an English weekday or 'EOM'. Defines the reference point for later adjustments.

  • expiry_month_offset – Number of months to offset the reference date from the contract/delivery month.

  • expiry_week_n – Which instance of the given weekday to start the reference date from. (E.g. 3rd Wednesday) Must be non-zero for expiry_adjust_by_cd to take effect. Can be -1 (-2), in which case the last (second to last) weekday will be picked.

  • expiry_adjust_by_cd – Number of calendar days to adjust reference date by.

  • expiry_bdc – Business day convention to use for final adjustment, i.e. 'FOLLOWING', 'MOD_FOL', 'PRECEDE', 'MOD_PRE', 'NONE_RULE'

  • expiry_adjust_start – Whether to adjust the reference date to fall on a business day.

  • expiry_offset – Final adjustment to reference date. (E.g. '2BD' or '-3D')

  • holiday_calendar – Calendar string identifier.

  • expiry_adjust_start_bdc – Business day convention to use for adjustment of reference date (either 'PREVIOUS' or 'FOLLOWING').

Returns

Calculated expiry date.

sigtech.framework.instruments.utils.future_contract_year(ticker: str)

Returns the contract year of the provided ticker.

Parameters

ticker – String input ticker

Returns

Contract year of provided ticker