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

What controls default Z order using Plot in indicator

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

    What controls default Z order using Plot in indicator

    I two indicators that I have created.

    One draws lines over candle bodies, the other draws lines behind the bodies.

    What is controlling this behavior?

    #2
    Hello tulanch,

    Thank you for your post.

    The order is determined by the order in which the plots were added to the chart. This cannot be changed programmatically, other than the order in which you are adding it.

    You can also change the Z-order manually from the chart itself

    New Chart Object Paint Ordering (z-order)
    As you select any object on a chart, hold down the SHIFT key and scroll with your mouse wheel, you can change the paint layer of the selected object in order to move it in front of or behind other drawn objects. In the image below, the rectangle is selected and is currently on "Level 5 of 5" meaning, it is at the very bottom of the paint order. You could scroll your mouse wheel to "Level 1 of 5" which would put the rectangle on top of all others objects.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by tulanch View Post
      I two indicators that I have created.

      One draws lines over candle bodies, the other draws lines behind the bodies.

      What is controlling this behavior?
      If you want to force the indicator to plot behind the price bars, give the whole indicator a negative z-order. Conversely to plot on top of the price bars, give the indicator a high z-order.

      Code:
      Initialize()
      {
      // ...
      Z-Order = -10; // forces a plot behind the price bars
      }

      Comment


        #4
        As I mentioned I have 2 indicators I am comparing. When I first started this thread, neither of them had any Z order work done, yet one plotted infront and the other plotted behind.

        In the one which is behind, I've attempted to use both methods, but neither seem to affect this display. I will mucking around with it... and report back.... I need to make the indicator selectable.

        Also in the one that does have the drawline in front, it has a region draw behind where as the other does not, perhaps that has some impact...

        Comment


          #5
          Hello,

          To change z order on your own select one of the data series or indicators and then hold down shift and then scroll with your mouse wheel will allow you to push an indicator's z order below the other if you needed this done.

          Let me know if I can be of further assistance.

          Comment


            #6
            I belive I found an issue....

            At one point in the past I changed the chart property
            "Allow the selection or drag/drop of a chart series " from True to False as I do a lot of trading on the chart and don't want to pick things...just a person preference...

            this is why I could not select it and change the Z order per prior instructions...

            Once I did set this back to True, I was able to change the Z order...

            Also, once I did this I could change the Z order value in the Indicator initiate method

            again, all working fine...

            But, if the chart I put the indicator in was created/initiated with
            "Allow the selection or drag/drop of a chart series " set to False.... (ie using a chart template) then
            the Z order value set within the initiate method seems to do nothing....and the drawn items are behind the candle bars.... I can repeat this... perhaps this is just be design...

            to me weirdness explained and I can managed....

            maybe this thread will help others in future...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Fran888, 02-16-2024, 10:48 AM
            3 responses
            43 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Started by martin70, 03-24-2023, 04:58 AM
            15 responses
            114 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by The_Sec, Today, 02:29 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by jeronymite, 04-12-2024, 04:26 PM
            2 responses
            31 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by Mindset, 05-06-2023, 09:03 PM
            10 responses
            265 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X