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 traderzoso, 12-27-2020, 05:19 PM
        6 responses
        227 views
        0 likes
        Last Post lekor
        by lekor
         
        Started by ETFVoyageur, 05-18-2024, 12:45 AM
        4 responses
        26 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Skifree, Today, 11:47 AM
        4 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by molecool, Today, 01:48 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ETFVoyageur, Today, 12:26 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X