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

ZOrder doesn't work

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

    ZOrder doesn't work

    I have 2 indicators with a custom OnRender, but they are rendered in the wrong ZOrder.

    I set the ZOrder like this:
    Code:
    protected override void OnStateChange() {
        // ...
        if (State == State.Historical) {
            SetZOrder(-1);
        }
    }​
    The other indicator uses SetZOrder(0);

    The indicators are drawn in the wrong ZOrder, but when I flip the -1 and 0, nothing changes.
    The ZOrder has no effect.
    What am I doing wrong?

    #2
    Hello Bobin,

    Thanks for your post.

    We are currently researching this inquiry and we will follow up with more information as soon as we are done looking into this inquiry.

    Thanks for your patience; I look forward to assisting further.​
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hello Bobin,

      Thanks for your patience.

      Instead of using SetZOrder(-1) and SetZOrder(0) for the indicators, you could use SetZOrder(-1) on one indicator and SetZOrder(1) on the other indicator.

      The indicator set to use SetZOrder(1) would be drawn on top of the indicator set to use SetZOrder(-1).

      See the attached example scripts demonstrating this. SetZOrderTestIndi1 is set to use SetZOrder(-1) and SetZOrderTestIndi2 is set to use SetZOrder(1). When adding the indicators to a chart window, we can see the SetZOrderTestIndi2 magenta line is being drawn over top of the SetZOrderTestIndi1 blue line.

      SetZOrder: https://ninjatrader.com/support/help.../setzorder.htm

      Please let me know if I may assist further.
      Attached Files
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        Hello BrandonH,
        thank you very much! It works.
        So I guess we can't use 0 or any negative number other than -1.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cre8able, Today, 01:16 PM
        2 responses
        9 views
        0 likes
        Last Post cre8able  
        Started by chbruno, 04-24-2024, 04:10 PM
        3 responses
        48 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by samish18, Today, 01:01 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by WHICKED, Today, 12:56 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by WHICKED, Today, 12:45 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X