Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Z order - Strategy overwriting indicator

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

    Z order - Strategy overwriting indicator

    Hello, I have a strategy that uses amaATRTrailingStop which has a "color bars" feature. However, I am also using a "Outside Bar" indicator which colors the "outside" bars. When I enable the strategy, the amaATRTrailingStop from the "strategy" overwrites the "Outside Bar" from "indicators".

    The Outside bar indicator has a "z order" field... which I have to set to a very high number before it works...

    However, once I turn my strategy off, and enable it again.... It overwrites the "Outside bar" indicator again. And I have to go in and set a higher number.

    Is there a way to set the Z order in the strategy for amaATRTrailingStop, to the layer above the standard chart bar, but behind the "Outside bar" indicator? What would the setting be in the strategy to not interfere and overwrite the "Outside Bar" indicator?

    Thank you!
    Last edited by ldanenberg; 05-09-2024, 03:26 PM.

    #2
    Hello ldanenberg,

    Are you setting <Indicator>.SetZOrder() on the indicator instance from the strategy?


    Are these plots or drawing objects?

    If these are drawing objects are you setting ZOrderType on each drawing object?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      It is an “indicator” in the strategy that is coloring all the bars (no Z order is set). What value would the indicator in the strategy need to be set to for setZOrder()?

      I also have an indicator (not in the strategy) that colors select outside bars, and has a Z order field (default setting is 1)… What would be the best value to set this field (this one should be on top of the strategy “color bar” indicator).

      Can I assign the strategy “color bar” indicator Z order to 1 and the non-strategy “outside bar” indicator Z order field to 2?….. Or will the Z order reset every time I turn off then re-enable the strategy (which is happening now)?
      Last edited by ldanenberg; 05-10-2024, 01:19 PM.

      Comment


        #4
        Hello ldanenberg,

        "What value would the indicator in the strategy need to be set to for setZOrder()?"

        I don't understand this question. No particular value would need to be returned from the indicator to set the z-order with SetZOrder().

        private MyIndicatorName myIndy;

        myIndy = MyIndicatorName();
        MyIndicatorName.SetZOrder(-1);


        I also have an indicator (not in the strategy) that colors select outside bars, and has a Z order field (default setting is 1)… What would be the best value to set this field (this one should be on top of the strategy “color bar” indicator).

        You could try int.MaxValue to make sure this on top of everything. I don't know what ZOrder the other script has. The chart bars are ZOrder 1. Indicators start at 10001. Drawing objects start at 30001.



        "Can I assign the strategy “color bar” indicator Z order to 1 and the non-strategy “outside bar” indicator Z order field to 2?….. Or will the Z order reset every time I turn off then re-enable the strategy (which is happening now)?"

        The chart bars are z-order 1, as mentioned above. If you make your indicator also 1 it will likely be above the chart bars. You can set an indicator z-order to 2 if that is where you want the object layered.

        The z-order set with SetZOrder() will be set by the code each time script is run, so if you turn the script off and back on, it would just set the z-order again.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X