I serialize a public Color in an indicator for can choose in parameters. Its ok, but when i call the indicator properties from conditions builder of strategies wizard the color shows as a string in quotes:
For ex: 'Color [DodgerBlue]'
and i need to select other color, and change to DodgerBlue
If i dont change the strategy compilation launch an error.
Its possible to avoid this issue?
more better, its possible to avoid all unnecessary parameters in condition builder?
THank you
My code:
Declaring colors:
private Color longsignalcolor = Color.DodgerBlue;
private Color shortsignalcolor = Color.Magenta;
Into properties:
//Color shortsignalcolor
[Description("Color for short signal arrow")]
[GridCategory("Parameters")]
public Color ShortSignalColor{
get { return shortsignalcolor; }
set { shortsignalcolor = value; }
}
// Serialize our Color object
[Browsable(false)]
public string ShortSignalColorSerialize{
get { return NinjaTrader.Gui.Design.SerializableColor.ToString( ShortSignalColor); }
set { ShortSignalColor = NinjaTrader.Gui.Design.SerializableColor.FromStrin g(value); }
}
Comment