Skip to content

IOptionPositionCollectionEnumerator

QuantConnect.Securities.Option.StrategyMatcher.IOptionPositionCollectionEnumerator

Enumerates an OptionPositionCollection. The intent is to evaluate positions that may be more important sooner. Positions appearing earlier in the enumeration are evaluated before positions showing later. This effectively prioritizes individual positions. This should not be used filter filtering, but it could also be used to split a position, for example a position with 10 could be changed to two 5s and they don't need to be enumerated back to-back either. In this way you could prioritize the first 5 and then delay matching of the final 5.

enumerate

enumerate(
    positions: OptionPositionCollection,
) -> Iterable[OptionPosition]

Enumerates the provided positions. Positions enumerated first are more likely to be matched than those appearing later in the enumeration.