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.
equals
equals(other: OptionStrategyDefinitionMatch) -> bool
equals(obj: Any) -> bool
Signature descriptions:
-
Indicates whether the current object is equal to another object of the same type.
-
Determines whether the specified object is equal to the current object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
Optional[OptionStrategyDefinitionMatch]
|
An object to compare with this object. |
None
|
obj
|
Optional[Any]
|
The object to compare with the current object. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Depends on the signature used. Case 1: [true if the current object is equal to the other parameter; otherwise, false.]; Case 2: [true if the specified object is equal to the current object; otherwise, false.] |
__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. |