17 using System.Collections.Generic;
34 _buyingPowerModel = buyingPowerModel;
49 if (newPositions.Count != 1)
56 var position = newPositions.First();
57 group =
new PositionGroup(key, position.GetGroupQuantity(), newPositions.ToDictionary(p => p.Symbol));
69 .Select(position =>
new PositionGroup(_buyingPowerModel, position.GetGroupQuantity(), position)).ToList()
89 IReadOnlyCollection<IPosition> positions
92 var seen =
new HashSet<PositionGroupKey>();
93 foreach (var position
in positions)
95 IReadOnlyCollection<IPositionGroup> groupsForSymbol;
96 if (!groups.TryGetGroups(position.Symbol, out groupsForSymbol))
101 foreach (var group
in groupsForSymbol)
103 if (seen.Add(group.Key))