Report generation fails with null underlying for option orders

Back

I am trying to run the Lean Report generator locally from a json report downloaded from a run done on QuantConnect and it fails because a loaded option symbol has a null underlying reference and fails at SecurityService.cs line 131

If I look at the json, the option symbols do have the underlying:     

"Symbol": {
"Value": "WAG 101016P00025000",
"ID": "WAG 2YPXFKVWULF1I|WAG R735QTJ8XC9X",
"Permtick": "WAG 101016P00025000",
"Underlying": {
"Value": "WAG",
"ID": "WAG R735QTJ8XC9X",
"Permtick": "WAG"
}
}

Here is the stack:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00272] in /home/ari/Development/projects/Lean/Common/Securities/SecurityService.cs:131
at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00001] in /home/ari/Development/projects/Lean/Common/Securities/SecurityManager.cs:302
at QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders (System.Collections.Generic.IEnumerable`1[T] orders) [0x0006c] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooperAlgorithm.cs:45
at (wrapper remoting-invoke-with-check) QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders(System.Collections.Generic.IEnumerable`1<QuantConnect.Orders.Order>)
at QuantConnect.Report.PortfolioLooper..ctor (System.Double startingCash, System.Collections.Generic.List`1[T] orders, QuantConnect.Resolution resolution) [0x001ca] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:122
at QuantConnect.Report.PortfolioLooper+<FromOrders>d__13.MoveNext () [0x00283] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:270
at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1108
at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:87
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30
at QuantConnect.Report.Report..ctor (System.String name, System.String description, System.String version, QuantConnect.Packets.BacktestResult backtest, QuantConnect.Packets.LiveResult live) [0x00080] in /home/ari/Development/projects/Lean/Report/Report.cs:50
at QuantConnect.Report.Program.Main (System.String[] args) [0x0012c] in /home/ari/Development/projects/Lean/Report/Program.cs:73
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at QuantConnect.Securities.SecurityService.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00272] in /home/ari/Development/projects/Lean/Common/Securities/SecurityService.cs:131
at QuantConnect.Securities.SecurityManager.CreateSecurity (QuantConnect.Symbol symbol, System.Collections.Generic.List`1[T] subscriptionDataConfigList, System.Decimal leverage, System.Boolean addToSymbolCache) [0x00001] in /home/ari/Development/projects/Lean/Common/Securities/SecurityManager.cs:302
at QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders (System.Collections.Generic.IEnumerable`1[T] orders) [0x0006c] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooperAlgorithm.cs:45
at (wrapper remoting-invoke-with-check) QuantConnect.Report.PortfolioLooperAlgorithm.FromOrders(System.Collections.Generic.IEnumerable`1<QuantConnect.Orders.Order>)
at QuantConnect.Report.PortfolioLooper..ctor (System.Double startingCash, System.Collections.Generic.List`1[T] orders, QuantConnect.Resolution resolution) [0x001ca] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:122
at QuantConnect.Report.PortfolioLooper+<FromOrders>d__13.MoveNext () [0x00283] in /home/ari/Development/projects/Lean/Report/PortfolioLooper/PortfolioLooper.cs:270
at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:1108
at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs:87
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /builddir/build/BUILD/mono-6.12.0.90/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30
at QuantConnect.Report.Report..ctor (System.String name, System.String description, System.String version, QuantConnect.Packets.BacktestResult backtest, QuantConnect.Packets.LiveResult live) [0x00080] in /home/ari/Development/projects/Lean/Report/Report.cs:50
at QuantConnect.Report.Program.Main (System.String[] args) [0x0012c] in /home/ari/Development/projects/Lean/Report/Program.cs:73

I am up to date with master and am on commit 6cb4411f6e5fde0ad36900cc884a0b1a7f5194a8, tag 981

Update Backtest







 
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Ari,

Please save the result file in a dropbox and share a link to it here so we can reproduce the error. Sharing the backtest would help us reproduce it too.

Best,
Derek Melchin

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!