I am developing some automated strategies on my computer that my father then runs on his computer.
Yesterday I changed some user defined inputs in the Properties section, and everything is OK on my side, NT8 runs perfectly.
However, when I updated the strategies on my dad's computer, NT started to crash before it can even open.
I suspect it may be a serialization problem, as mentioned here: https://ninjatrader.com/support/foru...-inputs?t=4977
But I'm not sure since everything runs perfectly on my computer...
Here is the code of my new properties:
[NinjaScriptProperty]
[TypeConverter(typeof(MyMethods.PivotPeriodCollecti onConverter))]
[PropertyEditor("NinjaTrader.Gui.Tools.StringStanda rdValuesEditorKey")]
[Display(Name="Pivot Period:", Order=15, GroupName="Parameters")]
public PivotRange PivotPeriod
{
get { return myPivot; }
set { myPivot = value; }
}
And the related type converter:
public class PivotPeriodCollectionConverter: StringConverter
{
/// <summary>
/// This class supports a standard set of values that can be picked from a list.
/// </summary>
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
return true;
}
/// <summary>
/// Return true if the destinationType parameter is the same type as the class that uses this type converter.
/// </summary>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if (destinationType == typeof(PivotRange))
return true;
return base.CanConvertTo(context, destinationType);
}
/// <summary>
/// Ensure that the destinationType parameter is a String and that the value is the same type as the class that uses this type converter.
/// Return a string representation of the value object.
/// </summary>
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string) && value is PivotRange)
return value.ToString();
return base.ConvertTo(context, culture, value, destinationType);
}
/// <summary>
/// Parse the property value and convert it to the type of the class that uses this type converter.
/// </summary>
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
if (value is string)
{
if (value == "Daily")
return PivotRange.Daily;
else if (value == "Weekly")
return PivotRange.Weekly;
}
return base.ConvertFrom(context, culture, value);
}
/// <summary>
/// Return a StandardValuesCollection filled with the standard values.
/// </summary>
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(new string[] {"Daily", "Weekly"});
}
}
I also added this property :
[NinjaScriptProperty]
[Display(Name="MA trigger : ", Order=4, GroupName="Parameters")]
public MovingAverageEnum MovingAverageType
{
get { return movingAverageType; }
set { movingAverageType = value; }
}
And the enum:
public enum MovingAverageEnum
{
FastEma,
SlowSma
}
Do you guys think these properties need to be serialized, or xml ignored ?
I attached 2 log files. They state the following error: Strategy '154181414': unable to deserialize user data: There is an error in XML document (93, 4).
Any help would be appreciated,
Thank you

Alex
Comment