Runtime Error when adding option contract without explicitly adding equity to portfolio
Expected Behavior
We should not get the error and the prices should convert to Raw mode automatically since the equity is not in the portfolio.
Actual Behavior
When we use AddOptionContract() method without explicitly adding equity to the portfolio it throws a runtime error.
"The underlying Equity asset (PARA) is set to Adjusted, please change this to DataNormalizationMode.Raw with the SetDataNormalization() method at QuantConnect.Algorithm.QCAlgorithm.AddOptionContract(Symbol symbol, Nullable`1 resolution, Boolean fillForward, Decimal leverage, Boolean extendedMarketHours) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Algorithm/QCAlgorithm.cs:line 2354"
Potential Solution
Reproducing the Problem
Used these steps to reproduce the error:
- Symbol.Create to avoid getting underlying data
- got option symbols from OptionChainProvider and also created option symbols using Symbol.CreateOption
- Added option contracts using AddOptionContract
Attached backtest for reference: https://www.quantconnect.com/terminal/processCache?request=embedded_backtest_d454480026bc4855024d87c2b5364479.html
System Information
Tested on QC cloud.
Checklist
- [X] I have completely filled out this template
- [X] I have confirmed that this issue exists on the current
masterbranch - [X] I have confirmed that this is not a duplicate issue by searching issues
- [X] I have provided detailed steps to reproduce the issue