In the attachment you can clearly see plot of arrow missing for the first 10 bars and then it start working.
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "TestArrow";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
//DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
ShowSeries1 = true;
AddPlot(Brushes.Orange, "PlotSeries1");
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
Series1 = new Series<double>(this);
}
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
if ( CurrentBar < 2) return;
if ( High[0] > High[1] ) {
Draw.Text(this,@"t1"+CurrentBar,"H",0,High[0]+8*TickSize,Plots[0].Brush);
PlotSeries1[0]=High[0]+3*TickSize;
}
}
Comment