OptionStrategyLegPredicateReferenceValue
QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicateReferenceValue
OptionStrategyLegPredicateReferenceValue(
index: int, target: PredicateTargetValue
)
Bases: Object, IOptionStrategyLegPredicateReferenceValue
Provides an implementation of IOptionStrategyLegPredicateReferenceValue that references an option leg from the list of already matched legs by index. The property referenced is defined by PredicateTargetValue
Initializes a new instance of the IOptionStrategyLegPredicateReferenceValue class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
The legs list index |
required |
target
|
PredicateTargetValue
|
The property value being referenced |
required |
resolve
resolve(legs: Sequence[OptionPosition]) -> Object
Resolves the value of the comparand specified in an OptionStrategyLegPredicate. For example, the predicate may include ... > legs<0>.Strike, and upon evaluation, we need to be able to extract leg<0>.Strike for the currently contemplated set of legs adhering to a strategy's definition.