Exchange

Exchange#

class sigtech.framework.instruments.base.Exchange

Baseclasses: ContractGroup

Exchange class, detailing timezone and trading hours.

Keyword arguments:

  • holidays - holiday calendars determining open exchange days (can be overridden by instrument)

  • timezone - time zone string

  • exchange_open - time when exchange opens on a good business day (can be overridden by instrument)

  • exchange_close - time when exchange closes on a good business day (can be overridden by instrument)

  • exchange_code - internal identifier for exchanges

  • description - string description of exchange meta details

  • due_time - time when data from the exchange is expected to be in the system

  • publication_delay - publication delay of data from the exchange

Example object creation:

from sigtech.framework.instruments.base import Exchange

exchange = Exchange(
        description='Dummy exchange for dummy futures',
        due_time='23:59:00',
        exchange_close='16:30:00',
        exchange_code='DUM EXCHANGE GROUP',
        exchange_open='09:00:00',
        holidays='DUMMY',
        product_type='Exchange',
        publication_delay='0BD',
        timezone='Europe/London'
    )
description: Optional[str]
due_time: time
exchange_close: time

Default closing time of day for the exchange. Can be overridden by an individual instrument.

exchange_code: str
exchange_open: time

Default opening time of day for the exchange. Can be overridden by an individual instrument.

holidays: str

Default holiday calendar identifier for the exchange. Can be overridden by an individual instrument.

item_product_type: str
timezone: str
classmethod from_contract(code: str, env: Optional[ConfiguredEnvironment] = None) Self

Return the exchange object from contract code.

Parameters:
  • code – Contract code.

  • env – Configured environment (optional).

Returns:

Exchange object.

group_by_type() DataGroupBy

Specifies object type identifier, full list available from DataGroupBy.

Returns:

Objects type string identifier

classmethod name_from_contract(code: str) str

Return the exchange identifier from contract code.

Parameters:

code – Contract code.

Returns:

Exchange identifier.

open_close_datetimes(d: date)

Gets the open and close times of the exchange for this day in UTC

session_data()

Returns the raw Copp-Clarke trading sessions data for this exchange