51 liveNodeConfiguration.
BrokerageData = brokerageFactory.BrokerageData;
53 catch (InvalidOperationException error)
55 throw new InvalidOperationException($
"{nameof(BrokerageDataDownloader)}.An error occurred while resolving brokerage data for a live job. Brokerage: {liveNodeConfiguration.Brokerage}.", error);
60 _brokerage.
Message += (
object _, Brokerages.BrokerageMessageEvent e) =>
62 if (e.Type == Brokerages.BrokerageMessageType.Error)
64 Logging.Log.Error(e.Message);
68 Logging.Log.Trace(e.Message);
82 var symbol = dataDownloaderGetParameters.
Symbol;
83 var resolution = dataDownloaderGetParameters.
Resolution;
84 var startUtc = dataDownloaderGetParameters.
StartUtc;
85 var endUtc = dataDownloaderGetParameters.
EndUtc;
86 var tickType = dataDownloaderGetParameters.
TickType;
89 var exchangeHours = _marketHoursDatabase.GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);
90 var dataTimeZone = _marketHoursDatabase.GetDataTimeZone(symbol.ID.Market, symbol, symbol.SecurityType);
92 var symbols =
new List<Symbol> { symbol };
93 if (symbol.IsCanonical())
95 symbols = GetChainSymbols(symbol,
true).ToList();
101 var request =
new Data.HistoryRequest(startUtc, endUtc, dataType, symbol, resolution, exchangeHours: exchangeHours, dataTimeZone: dataTimeZone, resolution,
108 Logging.Log.Trace($
"{nameof(BrokerageDataDownloader)}.{nameof(Get)}: Ignoring history request for unsupported symbol {symbol}");
113 .Where(history => history !=
null)
114 .SelectMany(history => history);
122 private IEnumerable<Symbol> GetChainSymbols(
Symbol symbol,
bool includeExpired)
126 return universeProvider.LookupSymbols(symbol, includeExpired);
130 throw new InvalidOperationException($
"{nameof(BrokerageDataDownloader)}.{nameof(GetChainSymbols)}: The current brokerage does not support fetching canonical symbols. Please ensure your brokerage instance supports this feature.");