protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Plots rectangles at support and resistance areas. Can be used on multiple timeframes.";
Name = "MTFDSRLevelsTick";
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;
TickTimeframe = 1000;
Strength = 5;
BullishOut = Brushes.Lime;
BullishBod = Brushes.ForestGreen;
BearishOut = Brushes.Red;
BearishBod = Brushes.DarkRed;
Opacity = 15;
BehindBars = true;
BehindBarsAdj = 1;
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, TickTimeframe);
}
}
protected override void OnBarUpdate()
{
if(BehindBars == true)
{
// Make sure our object plots behind the chart bars
SetZOrder(-1);
}
else if(BehindBars == false)
{
SetZOrder(BehindBarsAdj);
}
if (CurrentBars[0] < BarsRequiredToPlot || CurrentBars[1] < BarsRequiredToPlot)
return;

Comment