User definable inputs do not need to be limited to numeric values. You can have colors as an input as well. To do this you will need to make a public property for a Color object instead of an int or double.
In the "Properties" region of your code, there is only a slight change in the code snippet you would normally use to create user definable inputs. You need an extra line above the Description field.
[COLOR=Red][XmlIgnore()][/COLOR] [Description("Color for painted region")] [GridCategory("Parameters")]
public [COLOR=red]Color[/COLOR] PaintColor { get { return paintColor; } set { paintColor = value; } }
Some additional extra code that is required for creating a color input is to serialize the color. Serialization is necessary for NinjaTrader to use the color input throughout the program. Please note that serialization is a general concept not exclusive to color inputs. There may be other struct/classes (e.g. TimeSpan) that you could use in your code that would also need to have their "value" properties serialized.
[Browsable(false)] public string PaintColorSerialize { get { return NinjaTrader.Gui.Design.SerializableColor.ToString(paintColor); } set { paintColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); } }
Comment