protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"My Test.";
Name = "MyTest";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
IsSuspendedWhileInactive = true;
AddPlot(new Stroke(Brushes.Orange, DashStyleHelper.Dash, 4), PlotStyle.Line, "LineProperties");
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if(CurrentBar < 10)
return;
Draw.Line(this, "AB", true, 9, High[9], 0, Low[0], true, "LineProperties");
LineProperties[0] = 72.45; //This draws a line at the price of 68.55 and is controlled by the color, linetype etc From AddPlot
//Values[0][0] = Median[0]; //This draws a line from the middle of each bar and is controlled by the color, linetype etc From AddPlot
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> LineProperties
{
get { return Values[0]; }
}
#endregion
}
Comment