public Task <IEnumerable <SymbolByFilterMessage> > GetSymbolsByFilterAsync(FieldToSearch fieldToSearch, string searchString, FilterType?filterType, IEnumerable <int> filterValues, string requestId = null)
        {
            var request = _symbolRequestFormatter.ReqSymbolsByFilter(fieldToSearch, searchString, filterType, filterValues, requestId);

            return(string.IsNullOrEmpty(requestId)
                ? GetMessagesAsync(request, _symbolMessageHandler.GetSymbolByFilterMessages)
                : GetMessagesAsync(request, _symbolMessageHandler.GetSymbolByFilterMessagesWithRequestId));
        }
示例#2
0
        public string ReqSymbolsByFilter(FieldToSearch fieldToSearch, string searchString, FilterType?filterType, IEnumerable <int> filterValues, string requestId = null)
        {
            // SBF,[Field To Search],[Search String],[Filter Type],[Filter Value],[RequestID]<CR><LF>
            var fieldToSearchFormat = ((char)fieldToSearch).ToString();
            var filterTypeFormat    = filterType.HasValue ? ((char)filterType).ToString() : string.Empty;
            var filterValuesFormat  = filterType.HasValue ? string.Join(" ", filterValues) : string.Empty;
            var request             = $"SBF,{fieldToSearchFormat},{searchString},{filterTypeFormat},{filterValuesFormat},{requestId}{IQFeedDefault.ProtocolTerminatingCharacters}";

            return(request);
        }
 public IEnumerable <SymbolByFilterMessage> GetSymbolsByFilter(FieldToSearch fieldToSearch, string searchString, FilterType?filterType,
                                                               IEnumerable <int> filterValues, string requestId = null)
 {
     return(GetSymbolsByFilterAsync(fieldToSearch, searchString, filterType, filterValues, requestId)
            .SynchronouslyAwaitTaskResult());
 }