OptionStrategyDefinitionMatch
QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyDefinitionMatch
OptionStrategyDefinitionMatch(
definition: OptionStrategyDefinition,
legs: Sequence[OptionStrategyLegDefinitionMatch],
multiplier: int,
)
Bases: Object, IEquatable[QuantConnect_Securities_Option_StrategyMatcher_OptionStrategyDefinitionMatch]
Defines a match of OptionPosition to a OptionStrategyDefinition
Initializes a new instance of the OptionStrategyDefinitionMatch class
multiplier
multiplier: int
The number of times the definition is able to match the available positions. Since definitions are formed at the 'unit' level, such as having 1 contract, the multiplier defines how many times the definition matched. This multiplier is used to scale the quantity defined in each leg definition when creating the OptionStrategy objects.
legs
legs: Sequence[OptionStrategyLegDefinitionMatch]
The OptionStrategyLegDefinitionMatch instances matched to the definition.
__eq__
__eq__(right: OptionStrategyDefinitionMatch) -> bool
OptionStrategyDefinitionMatch == Operator
Returns:
| Type | Description |
|---|---|
bool
|
True if they are the same. |
__ne__
__ne__(right: OptionStrategyDefinitionMatch) -> bool
OptionStrategyDefinitionMatch != Operator
Returns:
| Type | Description |
|---|---|
bool
|
True if they are not the same. |
create_strategy
create_strategy() -> OptionStrategy
Creates the OptionStrategy instance this match represents
get_hash_code
get_hash_code() -> int
Serves as the default hash function.
Returns:
| Type | Description |
|---|---|
int
|
A hash code for the current object. |
remove_from
remove_from(
positions: OptionPositionCollection,
) -> OptionPositionCollection
Deducts the matched positions from the specified positions taking into account the multiplier
to_string
to_string() -> str
Returns a string that represents the current object.
Returns:
| Type | Description |
|---|---|
str
|
A string that represents the current object. |