Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed Nov 5, 2024
1 parent eae30eb commit 37cb9d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Engine/DataFeeds/BacktestingChainProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,16 @@ private IEnumerable<Symbol> GetOptionSymbols(Symbol canonicalSymbol, DateTime da
{
IHistoryProvider historyProvider = Composer.Instance.GetPart<IHistoryProvider>();
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,
extendedMarketHours: false, marketHoursEntry.DataTimeZone);
var request = new HistoryRequest(
previousTradingDate,
date.AddDays(1),
typeof(OptionUniverse),
optionUniverseType,
canonicalSymbol,
Resolution.Daily,
marketHoursEntry.ExchangeHours,
Expand Down
2 changes: 1 addition & 1 deletion Tests/Algorithm/AlgorithmChainsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 37cb9d3

Please sign in to comment.