Hi,
Would suggest some more details like function name / line number etc be added in the error messages like "
2017-01-05 15:45:00 Runtime Error: System.NullReferenceException: Object reference not set to an instance of an object at QuantConnect.Lean.Engine.Engine.Run (QuantConnect.Packets.AlgorithmNodePacket job, System.String assemblyPath) [0x0062b] in <fe4f845f91f54235b620d7e2b0c8b6c8>:0 "
Debugging is very difficult, even with multiple Debug(""), statements in each function.
Regards
Vivek
Jared Broad
HI Vivek, Normally error messages do give more information. Please attach the project so we can help further.
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.
Sylvain Zenatti
Hi Jared,
I'd like to add that I'm facing the similar issue as Vivek.
Even on simple default project, I can see the stacktrace of methods called but won't get the line (always display ':0'). (Note that I'm quite new to QC and C# so I may miss something I didn't know about).
For example,
the below error happens when I try to run my algo back to 2006 but work on 2016-2017.
Runtime Error: System.NullReferenceException: Object reference not set to an instance of an object
at QuantConnect.Algorithm.CSharp.FreedomifyAlgorithm.OnData (QuantConnect.Data.Slice slice) [0x001d4] in <29048101a35047bcb758ebe1803d15a3>:0
at QuantConnect.Lean.Engine.AlgorithmManager.Run (QuantConnect.Packets.AlgorithmNodePacket job, QuantConnect.Interfaces.IAlgorithm algorithm, QuantConnect.Lean.Engine.DataFeeds.IDataFeed feed, QuantConnect.Lean.Engine.TransactionHandlers.ITransactionHandler transactions, QuantConnect.Lean.Engine.Results.IResultHandler results, QuantConnect.Lean.Engine.RealTime.IRealTimeHandler realtime, QuantConnect.Lean.Engine.Server.ILeanManager leanManager, System.Threading.CancellationToken token) [0x01259] in <31cdedea27904959b7e4bb9b6a9b9aae>:0 (Open Stacktrace)
Jared Broad
Object reference not set to an instance of an object at QuantConnect.Algorithm.CSharp.FreedomifyAlgorithm.OnData
This means its inside of your OnData method -- and without attached code its impossible to help debug it.
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.
Sylvain Zenatti
Hey Jared,
thanks for the reply and sorry if I wasn't clear.
I was just using this error message to illustrate the fact that I can't find the error's "line" in the error message.
It's not a big deal but if it is possible, knowing the error's line would really be a good feature to help saving some debug time.
Paranjay Paresh Desai
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.
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!