17 using System.Globalization;
68 public IReadOnlyCollection<Symbol>
Symbols {
get;
protected set; } = [];
85 Log.
Trace($
"{nameof(BaseDataDownloadConfig)}: Default market '{MarketName}' applied for SecurityType '{SecurityType}'");
88 if (!Market.SupportedMarkets().Contains(
MarketName))
90 throw new ArgumentException($
"The specified market '{MarketName}' is not supported. Supported markets are: {string.Join(",
", Market.SupportedMarkets())}.");
125 private static IReadOnlyCollection<Symbol> LoadSymbols(Dictionary<string, string> tickers,
SecurityType securityType,
string market)
127 if (tickers ==
null || tickers.Count == 0)
129 throw new ArgumentException($
"{nameof(BaseDataDownloadConfig)}.{nameof(LoadSymbols)}: The tickers dictionary cannot be null or empty.");
132 return tickers.Keys.Select(ticker => Symbol.Create(ticker, securityType, market)).ToList();
140 protected static DateTime
ParseDate(
string date) => DateTime.ParseExact(date, DateFormat.EightCharacter, CultureInfo.InvariantCulture);
152 if (!Enum.TryParse(value,
true, out TEnum result) || !Enum.IsDefined(result))
154 throw new ArgumentException($
"Invalid {typeof(TEnum).Name} specified: '{value}'. Please provide a valid {typeof(TEnum).Name}. " +
155 $
"Valid values are: {string.Join(",
", Enum.GetNames<TEnum>())}.");