if (State == State.SetDefaults)
{
Description = @"Example.";
Name = "Example";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = false;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = false;
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;
BehindBars = true;
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if(BehindBars == true)
{
// Make sure object plots behind the chart bars
SetZOrder(-1);
}
else if(BehindBars == false)
{
SetZOrder(1);
}
}
This has worked in the past because I have tested it.

Comment