From 37cb9d300e0f1d297594280b632ea9011f129144 Mon Sep 17 00:00:00 2001 From: Jhonathan Abreu Date: Tue, 5 Nov 2024 10:25:02 -0400 Subject: [PATCH] Minor changes --- Engine/DataFeeds/BacktestingChainProvider.cs | 5 +++-- Tests/Algorithm/AlgorithmChainsTests.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Engine/DataFeeds/BacktestingChainProvider.cs b/Engine/DataFeeds/BacktestingChainProvider.cs index 1d737232eb5e..4730f663ec58 100644 --- a/Engine/DataFeeds/BacktestingChainProvider.cs +++ b/Engine/DataFeeds/BacktestingChainProvider.cs @@ -107,7 +107,8 @@ private IEnumerable GetOptionSymbols(Symbol canonicalSymbol, DateTime da { IHistoryProvider historyProvider = Composer.Instance.GetPart(); var marketHoursDataBase = MarketHoursDatabase.FromDataFolder(); - var marketHoursEntry = marketHoursDataBase.GetEntry(canonicalSymbol.ID.Market, canonicalSymbol, canonicalSymbol.SecurityType); + var optionUniverseType = typeof(OptionUniverse); + var marketHoursEntry = marketHoursDataBase.GetEntry(canonicalSymbol, new [] { optionUniverseType }); date = date.Date; var previousTradingDate = Time.GetStartTimeForTradeBars(marketHoursEntry.ExchangeHours, date, Time.OneDay, 1, @@ -115,7 +116,7 @@ private IEnumerable GetOptionSymbols(Symbol canonicalSymbol, DateTime da var request = new HistoryRequest( previousTradingDate, date.AddDays(1), - typeof(OptionUniverse), + optionUniverseType, canonicalSymbol, Resolution.Daily, marketHoursEntry.ExchangeHours, diff --git a/Tests/Algorithm/AlgorithmChainsTests.cs b/Tests/Algorithm/AlgorithmChainsTests.cs index 019b72f9ec2c..0536ddece0d7 100644 --- a/Tests/Algorithm/AlgorithmChainsTests.cs +++ b/Tests/Algorithm/AlgorithmChainsTests.cs @@ -128,7 +128,7 @@ public void GetsMultipleFullDataOptionChainAsDataFrame([Values] bool flatten) var symbols = new[] { Symbols.GOOG, Symbols.SPX }; using var dataFrame = _algorithm.OptionChains(symbols, flatten).DataFrame; - var expectedOptionChains = symbols.ToDictionary(x => x, x => _optionChainProvider.GetOptionContractList(x, date.Date).ToList()); + var expectedOptionChains = symbols.ToDictionary(x => x, x => _optionChainProvider.GetOptionContractList(x, date).ToList()); var chainsTotalCount = expectedOptionChains.Values.Sum(x => x.Count); if (flatten)