Example #1
0
        public IEnumerable <Symbol> PerformSelection(DateTime utcTime, BaseDataCollection data)
        {
            var result = SelectSymbols(utcTime, data);

            if (ReferenceEquals(result, Unchanged))
            {
                return(Unchanged);
            }
            var selections = result.ToHashSet();
            var hasDiffs   = _previousSelections.Except(selections).Union(selections.Except(_previousSelections)).Any();

            _previousSelections = selections;
            if (!hasDiffs)
            {
                return(Unchanged);
            }
            return(selections);
        }
Example #2
0
        public override IEnumerable <Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)
        {
            var optionsUniverseDataCollection = data as OptionChainUniverseDataCollection;

            if (optionsUniverseDataCollection == null)
            {
                throw new ArgumentException(string.Format("Expected data of type '{0}'", typeof(OptionChainUniverseDataCollection).Name));
            }
            _underlying = optionsUniverseDataCollection.Underlying ?? _underlying;
            optionsUniverseDataCollection.Underlying = _underlying;
            if (_underlying == null || data.Data.Count == 0)
            {
                return(Unchanged);
            }
            var availableContracts = optionsUniverseDataCollection.Data.Select(x => x.Symbol);
            var results            = _option.ContractFilter.Filter(availableContracts, _underlying).ToHashSet();

            optionsUniverseDataCollection.FilteredContracts = results;
            return(results);
        }
Example #3
0
 public override IEnumerable <Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data)
 {
     return(_universeSelector(data.Data));
 }
Example #4
0
 public abstract IEnumerable <Symbol> SelectSymbols(DateTime utcTime, BaseDataCollection data);