|
Lean
$LEAN_TAG$
|
Defines a condition under which a particular OptionPosition can be combined with a preceding list of leg (also of type OptionPosition) to achieve a particular option strategy. More...
Public Member Functions | |
| OptionStrategyLegPredicate (BinaryComparison comparison, IOptionStrategyLegPredicateReferenceValue reference, Func< IReadOnlyList< OptionPosition >, OptionPosition, bool > predicate, Expression< Func< IReadOnlyList< OptionPosition >, OptionPosition, bool >> expression) | |
| Initializes a new instance of the OptionStrategyLegPredicate class More... | |
| bool | Matches (IReadOnlyList< OptionPosition > legs, OptionPosition position) |
| Determines whether or not the provided combination of preceding legs and current position adhere to this predicate's requirements. More... | |
| OptionPositionCollection | Filter (IReadOnlyList< OptionPosition > legs, OptionPositionCollection positions, bool includeUnderlying) |
| Filters the specified positions by applying this predicate based on the referenced legs. More... | |
| IOptionStrategyLegPredicateReferenceValue | GetReferenceValue () |
| Gets the underlying IOptionStrategyLegPredicateReferenceValue value used by this predicate. More... | |
| override string | ToString () |
| Returns a string that represents the current object. More... | |
Static Public Member Functions | |
| static OptionStrategyLegPredicate | Create (Expression< Func< IReadOnlyList< OptionPosition >, OptionPosition, bool >> expression) |
| Creates a new OptionStrategyLegPredicate from the specified predicate expression More... | |
Public Attributes | |
| bool | IsIndexed => _comparison != null && _reference != null |
| Determines whether or not this predicate is able to utilize OptionPositionCollection indexes. More... | |
Defines a condition under which a particular OptionPosition can be combined with a preceding list of leg (also of type OptionPosition) to achieve a particular option strategy.
Definition at line 30 of file OptionStrategyLegPredicate.cs.
| QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.OptionStrategyLegPredicate | ( | BinaryComparison | comparison, |
| IOptionStrategyLegPredicateReferenceValue | reference, | ||
| Func< IReadOnlyList< OptionPosition >, OptionPosition, bool > | predicate, | ||
| Expression< Func< IReadOnlyList< OptionPosition >, OptionPosition, bool >> | expression | ||
| ) |
Initializes a new instance of the OptionStrategyLegPredicate class
| comparison | The BinaryComparison invoked |
| reference | The reference value, such as a strike price, encapsulated within the IOptionStrategyLegPredicateReferenceValue to enable resolving the value from different potential sets. |
| predicate | The compiled predicate expression |
| expression | The predicate expression, from which, all other values were derived. |
Definition at line 50 of file OptionStrategyLegPredicate.cs.
| bool QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.Matches | ( | IReadOnlyList< OptionPosition > | legs, |
| OptionPosition | position | ||
| ) |
Determines whether or not the provided combination of preceding legs and current position adhere to this predicate's requirements.
Definition at line 67 of file OptionStrategyLegPredicate.cs.
| OptionPositionCollection QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.Filter | ( | IReadOnlyList< OptionPosition > | legs, |
| OptionPositionCollection | positions, | ||
| bool | includeUnderlying | ||
| ) |
Filters the specified positions by applying this predicate based on the referenced legs.
Definition at line 86 of file OptionStrategyLegPredicate.cs.
| IOptionStrategyLegPredicateReferenceValue QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.GetReferenceValue | ( | ) |
Gets the underlying IOptionStrategyLegPredicateReferenceValue value used by this predicate.
Definition at line 111 of file OptionStrategyLegPredicate.cs.
|
static |
Creates a new OptionStrategyLegPredicate from the specified predicate expression
Definition at line 119 of file OptionStrategyLegPredicate.cs.
| override string QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.ToString | ( | ) |
Returns a string that represents the current object.
Definition at line 240 of file OptionStrategyLegPredicate.cs.
| bool QuantConnect.Securities.Option.StrategyMatcher.OptionStrategyLegPredicate.IsIndexed => _comparison != null && _reference != null |
Determines whether or not this predicate is able to utilize OptionPositionCollection indexes.
Definition at line 40 of file OptionStrategyLegPredicate.cs.