Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

how do I remove the bottom panel?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how do I remove the bottom panel?

    I created an indicator to show the last 3 bars' range in the chart. This indicator also create a new panel right below the chart. how can I get rid of it?

    here's my code.


    Code:
    namespace NinjaTrader.NinjaScript.Indicators
    {
        public class AAJQrisk : Indicator
        {
            private Series<double> candleSizes;
            private TextFixed sizeLabel;
    
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Show last 3 bars' range";
                    Name                                        = "_JQrisk";
                    Calculate                                    = Calculate.OnEachTick;
                    IsOverlay                                    = true;
                    DisplayInDataBox                            = false;
                    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;
                }
                else if (State == State.DataLoaded)
                {
                    candleSizes = new Series<double>(this);
                    sizeLabel = Draw.TextFixed(this, "SizeLabel", "", TextPosition.TopRight, Brushes.White, new SimpleFont("Arial", 20), Brushes.Transparent, Brushes.Transparent, 0);
                    //sizeLabels = new TextFixed[3];
    
    //                for (int i = 0; i < sizeLabels.Length; i++)
    //                {
    //                    sizeLabels[i] = Draw.TextFixed(this, "SizeLabel" + (i + 1).ToString(), "", TextPosition.TopRight, Brushes.White, new SimpleFont("Arial", 20), Brushes.Transparent, Brushes.Transparent, 0);
    //                }
    
                }
            }
    
            protected override void OnBarUpdate()
            {
                  if (CurrentBar >=2)
                {
    //                double currentCandleSize = Math.Abs(High[0] - Low[0]);
    //                candleSizes[0] = currentCandleSize;
    
    //                double lastCandleSize = candleSizes[1];
    
    //                sizeLabel.DisplayText = "Last Candle Size: " + lastCandleSize.ToString();
    
    
                    double candleSize0 = Math.Abs(High[0] - Low[0]);
                    double candleSize1 = Math.Abs(High[1] - Low[1]);
                    double candleSize2 = Math.Abs(High[2] - Low[2]);
    
                    sizeLabel.DisplayText = candleSize2.ToString() + " --- " + candleSize1.ToString()  + " --- " + candleSize0.ToString();
                        //sizeLabels[i].Point = new System.Windows.Point(ChartControl.LastBarPainted, High[i] + TickSize);
    
                }
            }
        }
    }​

    Click image for larger version

Name:	remove.jpg
Views:	126
Size:	57.0 KB
ID:	1272968

    #2
    Hello qinking127,

    Thanks for your post.

    The IsOverlay property determines if the indicator should be placed on the price panel or if it should be placed in a separate indicator panel. When this property is set to true, the indicator will be drawn on the price panel.

    The DrawOnPricePanel property should also be set the true so that draw objects are drawn on the price panel.

    IsOverlay: https://ninjatrader.com/support/help.../isoverlay.htm
    DrawOnPricePanel: https://ninjatrader.com/support/help...pricepanel.htm

    See this help guide page for information about how to use Draw.TextFixed(): https://ninjatrader.com/support/help..._textfixed.htm

    I attached a simple test script demonstrating the concept of using TextFixed that you could view. Note that when this indicator is applied to the chart, the indicator in placed on the price panel and draws text in the top right corner of the chart.​
    Attached Files
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Since your IsOverlay was already being set to true,
      BrandonH's advice seems a bit incomplete.

      After you recompile this indicator with IsOverlay
      set to true, you'll need to remove the indicator
      from all charts and re-add the indicator. That
      should absolutely remove the bottom panel.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, Today, 10:38 PM
      0 responses
      5 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by JesseOffshore, Today, 09:40 PM
      0 responses
      1 view
      0 likes
      Last Post JesseOffshore  
      Started by WHICKED, 04-26-2024, 12:56 PM
      4 responses
      140 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by ezrollin, 02-26-2022, 11:14 PM
      7 responses
      207 views
      0 likes
      Last Post kenz987
      by kenz987
       
      Started by rocketman7, Today, 08:34 PM
      0 responses
      8 views
      0 likes
      Last Post rocketman7  
      Working...
      X