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 guillembm, Yesterday, 11:25 AM
            2 responses
            9 views
            0 likes
            Last Post guillembm  
            Started by junkone, 04-21-2024, 07:17 AM
            9 responses
            68 views
            0 likes
            Last Post jeronymite  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            4 responses
            20 views
            0 likes
            Last Post trilliantrader  
            Started by mgco4you, Yesterday, 09:46 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by wzgy0920, Yesterday, 09:53 PM
            0 responses
            10 views
            0 likes
            Last Post wzgy0920  
            Working...
            X