17 using System.Collections;
18 using System.Collections.Generic;
32 public int Count => _positions.Count;
47 public IEnumerable<IPosition>
Positions => _positions.Values;
54 private readonly Dictionary<Symbol, IPosition> _positions;
76 : this(key, quantity, positions.ToDictionary(p => p.
Symbol))
91 _positions = positions;
94 if (positions.Any(kvp => Math.Abs(kvp.Value.Quantity / kvp.Value.UnitQuantity) != Math.Abs(
Quantity)))
109 return _positions.TryGetValue(symbol, out position);
116 return $
"{Key}: {Quantity}";
128 IEnumerator IEnumerable.GetEnumerator()