Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonabreul committed Dec 13, 2024
1 parent da392b1 commit 7813ce7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Common/Securities/Option/OptionSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public static class OptionSymbol
{
private static readonly Dictionary<string, byte> _optionExpirationErrorLog = new();

private static readonly Dictionary<Symbol, DateTime> _expirationDateTimes = new();

/// <summary>
/// Returns true if the option is a standard contract that expires 3rd Friday of the month
/// </summary>
Expand Down Expand Up @@ -173,11 +171,6 @@ private static bool TryGetExpirationDateTime(Symbol symbol, out DateTime expiryT

exchangeHours = MarketHoursDatabase.FromDataFolder().GetExchangeHours(symbol.ID.Market, symbol, symbol.SecurityType);

if (_expirationDateTimes.TryGetValue(symbol, out expiryTime))
{
return true;
}

// Ideally we can calculate expiry on the date of the symbol ID, but if that exchange is not open on that day we
// will consider expired on the last trading day close before this; Example in AddOptionContractExpiresRegressionAlgorithm
var lastTradingDay = exchangeHours.IsDateOpen(symbol.ID.Date)
Expand All @@ -203,8 +196,6 @@ private static bool TryGetExpirationDateTime(Symbol symbol, out DateTime expiryT
expiryTime = symbol.ID.Date.AddDays(1).Date;
}

_expirationDateTimes[symbol] = expiryTime;

return true;
}
}
Expand Down

0 comments on commit 7813ce7

Please sign in to comment.