I'm looking to add a Draw.ArrowDown / Draw.ArrowUp object to an indicator panel. Below is the code. I have debugged the key statements and the Draw.Arrow statements are being executed but the arrow doesn't show in the indicator panel.
Is the code correct?
What is the correct way to add this indicator to the Chart / indicator panel? What is odd is if I select Panel 1 in the Indicators window, the arrows show up on the price panel in the correct locations in relation to the indicator panel below. If I select Panel 3, a new panel (oddly?!) is added between the panel it should be on (Panel 2) and the bottom panel (another indicator). But, if I select Panel 2 (the desired panel/indicator), they do not show.
When adding to the chart, for the Input Series, I have [IndicatorName](Instrument(15 Minute...
Thank you!
Matt
=======
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"My custom indicator";
Name = "MyCustomIndicator23";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = false;
DrawOnPricePanel = false;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = false;
BarsRequiredToPlot = 10;
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;
// Setting defaults
}
else if (State == State.Configure) {}
else if (State == State.DataLoaded) {
// Set values
}
}
protected override void OnBarUpdate() {
if (CurrentBar < BarsRequiredToPlot) return;
if (( -- Long conditions -- ) {
Draw.ArrowUp(this, "RSIspkLong" + CurrentBar, IsAutoScale, 3, Low[3] - 2, Brushes.YellowGreen);
}
else if ( -- Short conditions -- ) {
Draw.ArrowDown(this, "RSIspkShort" + CurrentBar, IsAutoScale, 3, High[3] + 2, Brushes.PaleVioletRed);
}
}

Comment