17 using System.Collections;
18 using System.Collections.Generic;
20 using System.Linq.Expressions;
53 _predicates = predicates.ToArray();
63 public IEnumerable<OptionStrategyLegDefinitionMatch>
Match(
65 IReadOnlyList<OptionPosition> legs,
69 foreach (var position
in options.Enumerate(
Filter(legs, positions,
false)))
71 var multiplier = position.Quantity /
Quantity;
75 position.WithQuantity(multiplier *
Quantity)
88 positions = positions.
Slice(
Right, includeUnderlying);
96 positions = positions.
Slice(side, includeUnderlying);
104 foreach (var predicate
in _predicates)
106 positions = predicate.Filter(legs, positions, includeUnderlying);
107 if (positions.IsEmpty)
173 IEnumerable<Expression<Func<IReadOnlyList<OptionPosition>,
OptionPosition,
bool>>> predicates
187 foreach (var predicate
in _predicates)
189 yield
return predicate;
193 IEnumerator IEnumerable.GetEnumerator()