Skip to content

ISymbolMapper

QuantConnect.Brokerages.ISymbolMapper

Provides the mapping between Lean symbols and brokerage specific symbols.

get_brokerage_symbol

get_brokerage_symbol(
    symbol: Union[Symbol, str, BaseContract],
) -> str

Converts a Lean symbol instance to a brokerage symbol

Parameters:

Name Type Description Default
symbol Union[Symbol, str, BaseContract]

A Lean symbol instance

required

Returns:

Type Description
str

The brokerage symbol.

get_lean_symbol

get_lean_symbol(
    brokerage_symbol: str,
    security_type: SecurityType,
    market: str,
    expiration_date: Union[datetime, date] = ...,
    strike: float = 0,
    option_right: OptionRight = 0,
) -> Symbol

Converts a brokerage symbol to a Lean symbol instance

Parameters:

Name Type Description Default
brokerage_symbol str

The brokerage symbol

required
security_type SecurityType

The security type

required
market str

The market

required
expiration_date Union[datetime, date]

Expiration date of the security(if applicable)

...
strike float

The strike of the security (if applicable)

0
option_right OptionRight

The option right of the security (if applicable)

0

Returns:

Type Description
Symbol

A new Lean Symbol instance.