Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Z-Order Based on Value

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

    Z-Order Based on Value

    Hello,
    I have a question regarding how to make one plot be in front of another. So, what I'm trying to do is to have 2 MACD indicators with different settings. I want to have the MACD indicator that is currently the highest to be in the back and the other with the lower value in front. I would like to make them switch when their values change (the other in front).
    I'm new to coding but if anyone has some suggestions I would truly appreciate it.
    Thank you for your time.
    James

    #2
    Originally posted by laoshr View Post
    Hello,
    I have a question regarding how to make one plot be in front of another. So, what I'm trying to do is to have 2 MACD indicators with different settings. I want to have the MACD indicator that is currently the highest to be in the back and the other with the lower value in front. I would like to make them switch when their values change (the other in front).
    I'm new to coding but if anyone has some suggestions I would truly appreciate it.
    Thank you for your time.
    James
    Hi,

    This can not be done. Assigning specific ZOrder indices to draw at should be done once the State has reached State.Historical​.

    Comment


      #3
      Hello James,

      Thanks for your post.

      trendisyourfriend is correct in their statement on the topic.

      The only way to accomplish this would be to use OnRender() from a single indicator and render your own plots where the datasets are rendered at specific zorders by having one on top later in rendering. The order OnRender() calls would determine the zorder, such as calling the rendering code for the backmost item first.

      You could check out the Ichimoku Cloud indicator from the Ecosystem User App Share page linked below for an example of custom rendering an indicator.

      Ichimoku Cloud: https://ninjatraderecosystem.com/use...indicator-nt8/

      There is also an example script on this forum thread you could view demonstrating dynamically rendering plot lines: https://forum.ninjatrader.com/forum/...24#post1109624


      The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
      <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

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      661 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      375 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X