During the test of a strategy we get this exception randomly. Was investigating and cannot understand what is the reason for that...
InstrumentInput1 is NinjaTrader.Cbi.Instrument object
I am starting to suspect that this problem is because of the data provider but am not sure... We are using Interactive Brokers account for testing
Thank you in advance
P.S.
If you need any additional info just let me know
2020-09-07 15:55:55:011|3|524288|Error on executing DB command: System.InvalidOperationException: There was an error reflecting type 'NinjaTrader.NinjaScript.Strategies.TestStrat.Test StrategyV1'. ---> System.InvalidOperationException: There was an error reflecting property 'InstrumentInput1'. ---> System.InvalidOperationException: There was an error reflecting type 'NinjaTrader.Cbi.Instrument'. ---> System.InvalidOperationException: Cannot serialize member 'NinjaTrader.Cbi.Instrument.HistoricalData' of type 'NinjaTrader.Data.BarsBytes[]', see inner exception for more details. ---> System.InvalidOperationException: NinjaTrader.Data.BarsBytes cannot be serialized because it does not have a parameterless constructor.
--- End of inner exception stack trace ---
at System.Xml.Serialization.StructModel.CheckSupporte dMember(TypeDesc typeDesc, MemberInfo member, Type type)
at System.Xml.Serialization.StructModel.GetPropertyMo del(PropertyInfo propertyInfo)
at System.Xml.Serialization.StructModel.GetFieldModel (MemberInfo memberInfo)
at System.Xml.Serialization.XmlReflectionImporter.Ini tializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortAccessorMapping(MemberMapping accessor, FieldModel model, XmlAttributes a, String ns, Type choiceIdentifierType, Boolean rpc, Boolean openModel, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortFieldMapping(StructModel parent, FieldModel model, XmlAttributes a, String ns, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Ini tializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.Ini tializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortElement(TypeModel model, XmlRootAttribute root, String defaultNamespace, RecursionLimiter limiter)
at System.Xml.Serialization.XmlReflectionImporter.Imp ortTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at NinjaTrader.NinjaScript.StrategyBase.ToXml()
at NinjaTrader.NinjaScript.StrategyBase.DbAdd()
at NinjaTrader.NinjaScript.StrategyBase.DbUpdate()
at NinjaTrader.Cbi.DB.DBThread()
Comment