Announcement

Collapse
No announcement yet.

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.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    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
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      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 rexsole, Yesterday, 03:21 PM
        2 responses
        17 views
        0 likes
        Last Post rexsole
        by rexsole
         
        Started by XXfea, Yesterday, 07:01 PM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by mrgreentrading, 04-11-2025, 08:41 PM
        10 responses
        95 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by ulisesguerrero, Today, 08:17 AM
        0 responses
        18 views
        0 likes
        Last Post ulisesguerrero  
        Started by raysinred, Yesterday, 10:32 AM
        2 responses
        28 views
        0 likes
        Last Post raysinred  
        Working...
        X