I created a plot in the indicator wizard, but it doesn't draw anything unless i add, under the logic:
Draw.Dot(this, "tag1"+ CurrentBar, false, 0, Low[0], Brushes.Orange);
and this only draws dots under the low of the bars.
What do i put instead of Low[0] to get it to draw the dots in their own panel on a flat horizontal level?
Here's the code:
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "squeezeDots";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = false;
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;
AddPlot(new Stroke(Brushes.Orange, 2), PlotStyle.Dot, "Dotz");
}
else if (State == State.Configure)
{
{
}
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 1)
return;
if ((Bollinger(Close, 2, 14).Upper[0] < KeltnerChannel(Close, 1.5, 10).Upper[0])
&& (Bollinger(Close, 2, 14).Lower[0] > KeltnerChannel(Close, 1.5, 10).Lower[0]))
{
Draw.Dot(this, "tag1"+ CurrentBar, false, 0, Low[0], Brushes.Orange);
}
}
How am I making this more complicated than it has to be?
Comment