17 using System.Collections.Generic;
35 private readonly Dictionary<Symbol, SymbolData> _symbolData =
new Dictionary<Symbol, SymbolData>();
53 _targetsCollection.AddRange(targets);
56 if (!_targetsCollection.IsEmpty)
58 foreach (var target
in _targetsCollection.OrderByMarginImpact(algorithm))
60 var symbol = target.Symbol;
67 if (!_symbolData.TryGetValue(symbol, out data))
81 algorithm.
MarketOrder(data.Security.Symbol, orderSize);
86 _targetsCollection.ClearFulfilled(algorithm);
97 foreach (var added
in changes.AddedSecurities)
99 if (!_symbolData.ContainsKey(added.Symbol))
101 _symbolData[added.Symbol] =
new SymbolData(algorithm, added);
105 foreach (var removed
in changes.RemovedSecurities)
109 if (_symbolData.TryGetValue(removed.Symbol, out data))
113 _symbolData.Remove(removed.Symbol);
114 algorithm.SubscriptionManager.RemoveConsolidator(removed.Symbol, data.Consolidator);
126 return !algorithm.
UniverseManager.Any(kvp => kvp.Value.ContainsMember(symbol));
134 if (unorderedQuantity > 0)