diff --git a/AssetManager.Infrastructure/Services/MarketDataService.cs b/AssetManager.Infrastructure/Services/MarketDataService.cs index 497e4b3..afa7af3 100644 --- a/AssetManager.Infrastructure/Services/MarketDataService.cs +++ b/AssetManager.Infrastructure/Services/MarketDataService.cs @@ -118,10 +118,9 @@ public class MarketDataService : IMarketDataService var endDate = DateTime.UtcNow; var startDate = CalculateStartDate(endDate, timeframe, limit); - var resampleFreq = GetTiingoResampleFreq(timeframe); - // Tiingo 历史数据端点 - var url = $"https://api.tiingo.com/tiingo/daily/{symbol}/prices?startDate={startDate:yyyy-MM-dd}&endDate={endDate:yyyy-MM-dd}&resampleFreq={resampleFreq}&token={_tiingoApiKey}"; + // Tiingo 历史数据端点(和示例一致) + var url = $"https://api.tiingo.com/tiingo/daily/{symbol}/prices?startDate={startDate:yyyy-MM-dd}&endDate={endDate:yyyy-MM-dd}&token={_tiingoApiKey}"; var response = await _httpClient.GetFromJsonAsync>(url); if (response == null) @@ -209,24 +208,6 @@ public class MarketDataService : IMarketDataService } } - /// - /// 转换为 Tiingo 的 resampleFreq - /// - private string GetTiingoResampleFreq(string timeframe) - { - return timeframe.ToLower() switch - { - "1min" => "1min", - "5min" => "5min", - "15min" => "15min", - "1h" => "1hour", - "1d" => "daily", - "1w" => "weekly", - "1m" => "monthly", - _ => "daily" - }; - } - /// /// 计算开始日期 ///