19 using System.Collections.Generic;
20 using System.Collections.Specialized;
30 private readonly HashSet<Symbol> _symbols;
38 : base(AdjustUniverseConfiguration(configuration), universeSettings,
Time.EndOfTimeTimeSpan,
40 Enumerable.Empty<
Symbol>())
42 _symbols =
new HashSet<Symbol>();
62 if (e.Action == NotifyCollectionChangedAction.Remove)
64 var removedSymbol = (
Symbol)e.OldItems[0];
65 _symbols.Remove(removedSymbol);
69 if (removedSymbol.SecurityType.IsOption()
70 && !_symbols.Any(symbol => symbol.SecurityType.IsOption() && symbol.Underlying == removedSymbol.Underlying))
72 Remove(removedSymbol.Underlying);
75 else if (e.Action == NotifyCollectionChangedAction.Add)
78 _symbols.Add((
Symbol)e.NewItems[0]);
81 base.OnCollectionChanged(e);
92 var ticker = $
"qc-universe-optioncontract-{securityType.SecurityTypeToLower()}-{market.ToLowerInvariant()}";
93 var underlying =
Symbol.
Create(ticker, securityType, market);
96 return new Symbol(sid, ticker);