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 jclose, Today, 09:37 PM
            0 responses
            5 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,413 views
            0 likes
            Last Post Traderontheroad  
            Started by firefoxforum12, Today, 08:53 PM
            0 responses
            11 views
            0 likes
            Last Post firefoxforum12  
            Started by stafe, Today, 08:34 PM
            0 responses
            11 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by sastrades, 01-31-2024, 10:19 PM
            11 responses
            169 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X