Skip to content

Commit

Permalink
Minor changes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed Jan 8, 2025
1 parent 679866d commit 1ed5069
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Common/Data/Market/OptionContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ public static implicit operator Symbol(OptionContract contract)
/// </summary>
internal override void Update(BaseData data)
{
if (data.Symbol == Symbol)
if (data.Symbol.SecurityType.IsOption())
{
_optionData.Update(data);
}
else if (data.Symbol == UnderlyingSymbol)
else if (data.Symbol.SecurityType == Symbol.GetUnderlyingFromOptionType(Symbol.SecurityType))
{
_optionData.SetUnderlying(data);
}
Expand Down
3 changes: 0 additions & 3 deletions Research/QuantBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,9 @@ public OptionHistory OptionHistory(Symbol symbol, DateTime start, DateTime? end

var allSymbols = new HashSet<Symbol>();
var optionFilterUniverse = new OptionFilterUniverse(option);
var marketHoursEntry = MarketHoursDatabase.GetEntry(symbol, new[] { typeof(OptionUniverse) });

foreach (var date in QuantConnect.Time.EachTradeableDay(option, start, end.Value.AddDays(-1), extendedMarketHours))
{
var prevTradableDate = QuantConnect.Time.GetStartTimeForTradeBars(marketHoursEntry.ExchangeHours, start,
QuantConnect.Time.OneDay, 1, extendedMarketHours: false, marketHoursEntry.DataTimeZone);
var universeData = GetChainHistory<OptionUniverse>(symbol, date, out var underlyingData);

if (underlyingData is not null)
Expand Down

0 comments on commit 1ed5069

Please sign in to comment.