Hi QuantConnect Community,

I am trying to plot the implied volatility. I got this error when I pass an option contract to the IV function, I get this error: Exception: Please register to receive data for symbol 'SPY YJOKFAJ2WRD2|SPY R735QTJ8XC9X' using the AddSecurity() function. at QuantConnect.Algorithm.QCAlgorithm.GetSubscription(Symbol symbol, Nullable`1 tickType) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Algorithm/QCAlgorithm.Indicators.cs:line 2607 at QuantConnect.Algorithm.QCAlgorithm.CreateIndicatorName(Symbol symbol, String type, Nullable`1 resolution) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Algorithm/QCAlgorithm.Indicators.cs:line 2532. 

The code is as follows: 

current_date = qb.Time 

option_chain = qb.OptionChainProvider.GetOptionContractList(spy_option.Symbol, current_date) 

history = qb.History(spy.Symbol, 5, Resolution.Daily) 

current_price = history['close'].iloc[-1] 

# Define your filters 

min_strike = current_price * 0.97  # -3% of current equity price 

max_strike = current_price * 1.03  # +3% of current equity price 

min_expiry = current_date + timedelta(20) 

max_expiry = current_date + timedelta(40) 

# Filter the option contracts 

filtered_contracts = [contract for contract in option_chain if min_strike <= contract.ID.StrikePrice <= max_strike and min_expiry <= contract.ID.Date <= max_expiry] 

# Display filtered contracts 

for contract in filtered_contracts: 

underlying_history = qb.History(contract.Underlying, 30, Resolution.Daily) 

implied_volatility = qb.iv(contract) 

print(f"Symbol: {contract}, Strike: {contract.ID.StrikePrice}, Expiry: {contract.ID.Date}, impliedvolatility = {implied_volatility}")