LMEUtils

LMEUtils#

class sigtech.framework.instruments.lme_otc.LMEUtils

Generic common functions used internally inside of LME instruments classes.

exchange_code: Optional[str] = 'LME(T)'
spot_offset: Optional[str] = '2BD'
static create_lme_forward(delivery_date: Union[date, str], args_dict: dict)

Create generic, 3 Month, Spot, or 3rd Wednesday LME forward(future) depending on the delivery_date argument:

Parameters:
  • delivery_date'3M', 'SPOT', forward delivery date, or future delivery month (e.g. 'J19' or 'M20')

  • args_dict – should contain all the remaining required parameters for the corresponding instrument.

Returns:

if delivery_date = '3M', then LME3MForward is created, if delivery_date = 'SPOT', then LMECashForward is created, if delivery_date is a date, then a generic LMEForward is created with delivery_date being that date, and if delivery_date is a future delivery month ticker, e.g. 'K18' or 'Z20', then a 3rd Wednesday LMEFuture with delivery on that month is created.

static delivery_date(d, term)

Delivery date given reference date and term info.

Parameters:
  • d – Reference date.

  • term – Increment string stub (e.g. ‘1d’, ‘1bd’, ‘1b’, ‘1cd’).

Returns:

Delivery date.

static holidays()

List of holiday calendars.

static outright_future(underlying_ticker, future_ticker)

Return the outright future object given an underlying ticker and a future ticker.

Parameters:
  • underlying_ticker – Ticker of the underlying.

  • future_ticker – Ticker of the future.

Returns:

Object.

static outright_future_name(underlying_ticker, future_ticker)

Return the outright future name given an underlying ticker and a future ticker.

Parameters:
  • underlying_ticker – Ticker of the underlying.

  • future_ticker – Ticker of the future.

Returns:

Object.

static print_tickers()

Print the available tickers.

static rolling_3m_forward(underlying_ticker)

Return the 3M rolling forward given an underlying ticker.

Parameters:

underlying_ticker – Ticker of the underlying.

Returns:

Object.

static rolling_spread_contract(underlying_ticker, future_ticker)

Return the rolling spread contract given an underlying ticker and a future ticker.

Parameters:
  • underlying_ticker – Ticker of the underlying.

  • future_ticker – Ticker of the future.

Returns:

Object.

static rolling_spread_contract_name(underlying_ticker, future_ticker)

Return the rolling spread contract name given an underlying ticker and a future ticker.

Parameters:
  • underlying_ticker – Ticker of the underlying.

  • future_ticker – Ticker of the future.

Returns:

string

static schedule_stub_lme()

Schedule stub for all LME instruments.

static spot_contract(underlying_ticker)

Return the contract object given an underlying ticker.

Parameters:

underlying_ticker – Ticker of the underlying.

Returns:

Object.

static timezone()

Timezone info.