Error on executing DB command: System.InvalidOperationException: There was an error reflecting type 'NinjaTrader.NinjaScript.Strategies.T1V1S1V1FU'. ---> System.NotSupportedException: Cannot serialize member NinjaTrader.NinjaScript.Strategies.T1V1S1V1FU.Vari ablesDict of type System.Collections.Generic.Dictionary`2[[System.String mscorlib Version=4.0.0.0 Culture=neutral PublicKeyToken=b77a5c561934e089][NinjaTrader.NinjaScript.Indicators.ApolloAssetVari ables 0e14b8840c1d45c7a87f3e57b9425573 Version=8.0.26.0 Culture=neutral PublicKeyToken=null]] because it implements IDictionary. at System.Xml.Serialization.TypeScope.GetDefaultIndex er(Type type String memberInfo) at System.Xml.Serialization.TypeScope.ImportTypeDesc( Type type MemberInfo memberInfo Boolean directReference) at System.Xml.Serialization.TypeScope.GetTypeDesc(Typ e type MemberInfo source Boolean directReference Boolean throwOnError) 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 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.Cbi.DB.DBThread(),
The custom indicator is basically just a new blank indicator with public properties I am using as variables. The reason I threw these properties in an indicator was because in NT can't serialize new files that aren't a strategy or an indicator(at leased that's the impression I've been given).
Basically what I'm using this dictionary for is running multiple assets in the same strategy. Each item in the dictionary represents the variables for an asset. Using a dictionary like this is pretty crucial for the strategy, although if I am not able to use a dictionary I can probably get something else figured out.
I have already tried repairing the DB as well.
Any help would be appreciated!
Thanks,
-Parker

Comment