19 using System.Collections.Generic;
29 private DateTime _nextRefreshTimeUtc;
31 private readonly TimeSpan _refreshInterval;
33 private readonly Func<DateTime, IEnumerable<Symbol>> _futureChainSymbolSelector;
46 : this(refreshInterval, futureChainSymbolSelector, null)
57 TimeSpan refreshInterval,
58 Func<DateTime, IEnumerable<Symbol>> futureChainSymbolSelector,
62 _nextRefreshTimeUtc = DateTime.MinValue;
64 _refreshInterval = refreshInterval;
65 _universeSettings = universeSettings;
66 _futureChainSymbolSelector = futureChainSymbolSelector;
76 _nextRefreshTimeUtc = algorithm.
UtcTime + _refreshInterval;
78 var uniqueSymbols =
new HashSet<Symbol>();
79 foreach (var futureSymbol
in _futureChainSymbolSelector(algorithm.UtcTime))
83 throw new ArgumentException(
"FutureChainSymbolSelector must return future symbols.");
87 if (uniqueSymbols.Add(futureSymbol))
89 foreach (var universe
in algorithm.CreateFutureChain(futureSymbol,
Filter, _universeSettings))
91 yield
return universe;