Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetZOrder not working as expected

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

    SetZOrder not working as expected

    I'm not sure if this is a bug in my code but converting an indicator from NT7 to NT8. In my NT7 code I would do something like:

    Code:
    protected override void Initialize()
    {
      ...
      ZOrder = ZOrder - 1;
      ...
    And this would cause my drawings in
    Code:
    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    to go underneath the standard bar chart bars.

    However in NT8 I'm now doing:

    Code:
    protected override void OnStateChange()
    {
      ...
      else if (State == State.Active)
      {
        SetZOrder(-1);
      }
    However this seems to have no effect on the things I'm drawing in

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    Everything I draw goes on top of the bars. How can I get things I draw in OnRender to go under chart bars?

    #2
    Looks like I can get my desired outcome by setting ZOrder property directly in

    Code:
    else if (State == State.Configure)
    {
        ZOrder = -1;
    }
    which I learned about in this thread:

    Comment


      #3
      That is correct. You can think of State.SetDefaults and State.Configure as replacements for Initialize().
      Dave I.NinjaTrader Product Management

      Comment


        #4
        Cool... This works.

        But this doesn't: http://ninjatrader.com/support/helpG.../setzorder.htm

        You might want to fix that when you have time...

        Comment


          #5
          I was able to pin down an issue with ZOrder this morning which may be related, but I will not know for certain until we've resolved the issue that I discovered and tested SetZOrder() once more.
          Dave I.NinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, Yesterday, 10:06 AM
          0 responses
          14 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          11 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          9 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          4 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          31 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X