Skip to content

OptionStrategyLegDefinitionMatch

QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegDefinitionMatch

OptionStrategyLegDefinitionMatch(
    multiplier: int, position: OptionPosition
)

Bases: IEquatable[QuantConnect_Securities_Option_StrategyMatcher_OptionStrategyLegDefinitionMatch]

Defines the item result type of OptionStrategyLegDefinition.match, containing the number of times the leg definition matched the position (multiplier) and applicable portion of the position.

Initializes a new instance of the OptionStrategyLegDefinitionMatch struct

Parameters:

Name Type Description Default
multiplier int

The number of times the positions matched the leg definition

required
position OptionPosition

The position that matched the leg definition

required

multiplier

multiplier: int

The number of times the definition is able to match the position. For example, if the definition requires +2 contracts and the algorithm's position has +5 contracts, then this multiplier would equal 2.

position

position: OptionPosition

The position that was successfully matched with the total quantity matched. For example, if the definition requires +2 contracts and this multiplier equals 2, then this position would have a quantity of 4. This may be different than the remaining/total quantity available in the positions collection.

__eq__

__eq__(right: OptionStrategyLegDefinitionMatch) -> bool

OptionStrategyLegDefinitionMatch == Operator

Returns:

Type Description
bool

True if they are equal.

__ne__

__ne__(right: OptionStrategyLegDefinitionMatch) -> bool

OptionStrategyLegDefinitionMatch != Operator

Returns:

Type Description
bool

True if they are not equal.

create_option_position

create_option_position(multiplier: int) -> OptionPosition

Creates the appropriate OptionPosition for this matched position

Parameters:

Name Type Description Default
multiplier int

The multiplier to use for creating the OptionPosition. This multiplier will be the minimum multiplier of all legs within a strategy definition match. Each leg defines its own multiplier which is the max matches for that leg and the strategy definition's multiplier is the min of the individual legs.

required

create_option_strategy_leg

create_option_strategy_leg(multiplier: int) -> LegData

Creates the appropriate type of OptionStrategy.LegData for this matched position

Parameters:

Name Type Description Default
multiplier int

The multiplier to use for creating the leg data. This multiplier will be the minimum multiplier of all legs within a strategy definition match. Each leg defines its own multiplier which is the max matches for that leg and the strategy definition's multiplier is the min of the individual legs.

required

get_hash_code

get_hash_code() -> int

Returns the hash code for this instance.

Returns:

Type Description
int

A 32-bit signed integer that is the hash code for this instance.

to_string

to_string() -> str

Returns the fully qualified type name of this instance.

Returns:

Type Description
str

The fully qualified type name.