public void ShouldBeAbleToUpdateStockByMinuteHistory() { foreach (string symbol in stockList) { string newUpdatedFile = StockHistory.UpdateStockByMinuteHistoryFile(testingHttpClient.client, testingHttpClient.apiKey, symbol, testingHttpClient.path, true); Assert.IsNotNull(newUpdatedFile); } }
private static void UpdateTrackedSymbolsMyMinuteData(HttpClient client, string apiKey, string tradeDataPath, List <string> TrackedStockSymbols) { foreach (string symbol in TrackedStockSymbols) { Log.write($"Updating Market Hours for Symbols {symbol}"); string storageFolderPath = StockHistory.getSymbolsPriceHistoryPath(tradeDataPath, symbol, "ByMinute"); List <QuoteFile> priceByMinuteFiles = ReadWriteJSONToDisk.getQuotesFileListFromDirectory(storageFolderPath); DateTime MaxModDate = new DateTime(0); if (priceByMinuteFiles.Count() > 0) { MaxModDate = priceByMinuteFiles.Select(s => s.info.LastWriteTime).Max(); } if (DateTime.Now.AddDays(-1) > MaxModDate) { string newUpdatedFile = StockHistory.UpdateStockByMinuteHistoryFile(client, apiKey, symbol, tradeDataPath, true); Log.write($"Symbol By Minute updated {newUpdatedFile}"); Ultility.delay(250); } } }