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

SetZOrder() does it really set ZOrder?

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

    SetZOrder() does it really set ZOrder?


    Z is an int exposed in the UI:
    Code:
    else if (State == State.Historical)
    {
        Print(Core.Globals.Now.ToString("dddd, M/d/yy HH:mm:ss.fff") + " <<< " 
            + Name + " >>> State.Historical. SetZOrder(" + Z + ")") ;
                    
        SetZOrder(Z); // Z = -1 default here is below the bars
                   
        Print(Core.Globals.Now.ToString("dddd, M/d/yy HH:mm:ss.fff") + " <<< " 
            + Name + " >>> State.Historical." 
            + " After SetZOrder(" + Z + ") ZOrder = " + ZOrder ) ;
    }
    Here's the output generated:
    Sunday, 2/12/17 09:50:59.557 <<< MyIndicator >>> State.Historical. SetZOrder(-1)
    Sunday, 2/12/17 09:50:59.557 <<< MyIndicator >>> State.Historical. After SetZOrder(-1) ZOrder = -2
    and
    Sunday, 2/12/17 09:51:08.215 <<< MyIndicator >>> State.Realtime. ZOrder = -2
    Another check of ZOrder in OnRender():
    MyIndicator.OnRender: Current ZOrder level is: 0
    So, my question is this: does SetZOrder() work reliably?

    #2
    Hello tradesmart,

    Thank you for your post.

    The SetZOrder() function should work reliably in these circumstances. Are there any other objects on the chart that can affect the Z Order? Such as indicators, drawing objects, or instruments?

    I look forward to your response.

    Comment


      #3
      Yes, there are other indicators. Does this mean that the ZOrder set via SetZOrder() will be incremented automatically and not stick to the value set?

      Comment


        #4
        Hello tradesmart,

        Thank you for your response.

        That is correct, the ZOrder can change after the indicator is applied. Other objects added to the z scale (indicator plots, drawing objects, etc.) can change the order of the objects.

        Please let me know if you have any questions.

        Comment


          #5
          Thanks for the clarification.

          However, I would prefer that, if I go to the trouble of using SetZOrder(int) in my indicator code, NT8 would respect that and not override my setting. This sort of thing is one of my little pet peeves about NT. I set various attributes (MarketAnalyzer column widths, etc.) only to discover that NT has a mind of its own.

          Comment


            #6
            Hello tradesmart,

            Thank you for your response.

            I will forward your request to development to make the value of SetZOrder a value that cannot be changed by other objects.

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            179 views
            0 likes
            Last Post jeronymite  
            Started by ghoul, Today, 06:02 PM
            0 responses
            8 views
            0 likes
            Last Post ghoul
            by ghoul
             
            Started by Barry Milan, Yesterday, 10:35 PM
            6 responses
            19 views
            0 likes
            Last Post Barry Milan  
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Started by DJ888, 04-16-2024, 06:09 PM
            4 responses
            13 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Working...
            X