Hello,

The “Send Support” button does not do anything, so I posted this as a discussion.

I have a routine that mathematically calculates a strike price.  It calculated a strike that didn't exist, but the IF statement is issuing a Runtime Error:

if call_symbol not in slice.Bars:

  I've reduced the code to create a sample of the issue:

    def Initialize(self):
        self.SetStartDate(2022, 4, 26)
        self.SetEndDate(2022, 4, 26)
        self.SetCash(100000)

        self.index_symbol = self.AddIndex("SPX", Resolution.Minute).Symbol
        option = self.AddIndexOption(self.index_symbol, "SPXW")
        option.SetFilter(lambda universe: universe.IncludeWeeklys().Expiration(0, 0))
        self.option_symbol = option.Symbol

    def OnData(self, slice: Slice):
        if slice.Time.hour == 10 and slice.Time.minute==15:
            call_symbol = 'SPXW  220426C04195000'
            if call_symbol not in slice.Bars:
                self.Log("Call Not Found")
            else:
                self.Log("Call Found")

The error is:

[ERROR] FATAL UNHANDLED EXCEPTION:SecurityIdentifier.TryParseProperties(): Error parsing SecurityIdentifier: 'SPXW 220426C04195000', Exception: System.ArgumentOutOfRangeException: The specified market wasn't found in the markets lookup. Requested: 454. You can add markets by calling QuantConnect.Market.Add(string, int) (Parameter 'market'), at QuantConnect.SecurityIdentifier.GetMarketIdentifier(String market) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Common/SecurityIdentifier.cs:line 951, at QuantConnect.SecurityIdentifier.TryParseProperties(String value, Exception& exception, SecurityIdentifier& identifier) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Common/SecurityIdentifier.cs:line 899, Unhandled exception. System.ArgumentException: Object of type 'System.String' cannot be converted to type 'QuantConnect.Symbol'., at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast), at