Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Weird SetZOrder issue

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

    Weird SetZOrder issue

    My indicators won't change re-plot in front of the candles. All of the indicators that coded ignores my SetZOrder bool--even old indicators. Has this ever happened before with NT8? I tried resetting NT. I tried resetting my computer. It's like my indicators are ignoring my commands. Here is the piece of code that I use.

    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.

    #2
    I think I figured it out. I'll start adding an int with a plot order.

    Comment


      #3
      Hello jamestrader21x,

      Thanks for the post.

      To clarify, are you still seeing a problem with your suggestion from post #2? I am not completely clear on what you mean with that, if you solved the issue I will close the ticket.

      The only item which I can see from the sample you provided is that you likely need to add a Historical state check, the help guide notes this method should be called during Historical which happens before rendering.



      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X