Margin

Margin#

class sigtech.framework.instruments.cash.Margin

Baseclasses: Cash

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

Used to represent the cumulative strike on a future - i.e. a future bought at 95 would be represented as a buy of a Future instrument and a short position of 95 of Margin.

Keyword arguments:

  • currency

Example object creation:

from sigtech.framework.instruments.cash import Margin

margin = Margin(
    underlying='COZ18 COMDTY',
    currency='USD',
)
underlying: str
property underlying_instrument: Self

Object representing the underlying instrument.

static get_all_margin_str_ids(add_space: bool = False) list[str]

Return a list of unique margin identifiers.

Parameters:

add_space – If set to True, return the string identifiers with an extra space as first character.

Returns:

list.

static instrument_name_from_margin(margin_name: str) str

Instrument name from margin class identifier.

Parameters:

margin_name – Margin class identifier.

Returns:

Instrument name.

static margin_name_from_instrument(instrument_name: str) str

Margin class identifier from instrument name.

Parameters:

instrument_name – Instrument name.

Returns:

Margin class identifier.

trade_line(units, size_date, rounded_units=True)

Trade entry containing information about units and string representation.

Parameters:
  • units – Number of units.

  • size_date – Size date.

  • rounded_units – If True, use rounded units to get positions (optional True by default).

Returns:

Scaled units and trade description.