I am trying to change the color of the ellipse from the script interface.
I have another parameter under enum and it works correctly
but it seems that "Brushes" does not support enum configuration manually.
This is the closest I have come.
public enum DirectionBar
{
BarUP,
BarDown,
}
namespace NinjaTrader.NinjaScript.Strategies
{
public class Example1 : Strategy
{
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
("Default settings omitted for forum transcript")
ControlBar = DirectionBar.BarUP;
ColorElipse = Brushes.Green;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
//Add your custom strategy logic here.
if (ControlBar == DirectionBartolo.BarUP
&& Open[0] < Close[0])
{
Draw.Ellipse(this, "MyEllipseUP" + CurrentBar, 1, Low[0] -3 * TickSize, -1, High[0] +3* TickSize, ColorElipse);
}
}
[NinjaScriptProperty]
[Display(Name = "DirectionBar", GroupName = "Config", Order = 1)]
public DirectionBar ControlBar
{ get; set; }
[NinjaScriptProperty]
[Display(Name = "ColorElipse", GroupName = "Config", Order = 2)]
public ColorElipse colors
{ get; set; }
}
Any suggestions?
thank you very much


Comment