20 using System.Collections.Generic;
34 private DateTime _nextRefreshTimeUtc;
35 private IEnumerable<Symbol> _currentSymbols;
37 private readonly Func<OptionFilterUniverse, OptionFilterUniverse> _optionFilter;
51 Func<OptionFilterUniverse, OptionFilterUniverse> optionFilter,
54 _optionFilter = optionFilter;
55 _universeSettings = universeSettings;
56 _nextRefreshTimeUtc = DateTime.MaxValue;
58 _currentSymbols = Enumerable.Empty<
Symbol>();
62 _nextRefreshTimeUtc = DateTime.MinValue;
71 symbol.SecurityType.DefaultOptionStyle(),
86 PyObject optionFilter,
87 UniverseSettings universeSettings =
null): this(universe, ConvertOptionFilter(optionFilter), universeSettings)
98 _nextRefreshTimeUtc = DateTime.MaxValue;
100 foreach (var optionSymbol
in _currentSymbols)
102 yield
return algorithm.CreateOptionChain(optionSymbol, _optionFilter, _universeSettings);
106 private static Func<OptionFilterUniverse, OptionFilterUniverse> ConvertOptionFilter(PyObject optionFilter)
110 return optionFilter.ConvertToDelegate<Func<OptionFilterUniverse, OptionFilterUniverse>>();