Exemplo n.º 1
0
 public ThresholdCheck GetThresholdCheck(ExchangeSyncSetting setting)
 {
     return(new ThresholdCheck(
                nameof(SymbolDetailsChangeset),
                _changedSymbols.Count,
                setting.UpdateThresholdPercent));
 }
Exemplo n.º 2
0
 public ThresholdCheck GetThresholdCheck(ExchangeSyncSetting setting)
 {
     return(new ThresholdCheck(
                nameof(NewSymbolChangeset),
                _newSymbols.Count,
                setting.InsertThresholdPercent));
 }
Exemplo n.º 3
0
 public ThresholdCheck GetThresholdCheck(ExchangeSyncSetting setting)
 {
     return(new ThresholdCheck(
                nameof(SymbolDelistChangeset),
                _delistedSymbolIds.Count,
                setting.DeleteThresholdPercent));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Get all the listed traded symbols for for all major stock exchanges from nasdaq ftp
        /// </summary>
        /// <param name="syncSettings">The <see cref="ExchangeSyncSetting"/> containing sync settings.</ExchangeSyncSetting> </param>
        /// <returns>IReadOnlyDictionary with <see cref="SymbolKey"/> as key and <see cref="DownloadedSymbol"/> for the value.</returns>
        public async Task <IReadOnlyDictionary <SymbolKey, DownloadedSymbol> > GetTradedSymbols(ExchangeSyncSetting syncSettings)
        {
            _logger.LogTrace("Executing query http request url: {url}", syncSettings.Url);

            // no login necessary
            using var stream          = _ftpClient.DownloadFile(syncSettings.Url, string.Empty, string.Empty);
            using StreamReader reader = new StreamReader(stream);

            var tickerToSymbols = await _parser.GetSymbolMap(reader, syncSettings.Delimiter, syncSettings.SuffixBlackList);

            return(new ReadOnlyDictionary <SymbolKey, DownloadedSymbol>(tickerToSymbols));
        }