• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing z order programatically?

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

    #16
    Keltner

    try
    this.ZOrder = -1;

    Comment


      #17
      Originally posted by NinjaTrader_Bertrand View Post
      Joe, ZOrder = -1 in the Initialize() is an unsupported "trick" to have the bars be on top of that indicator study. You can experiment with setting different ZOrder levels but there would be currently no supported concept for ZOrders across different indicators / scripts - best would be setting the levels for your indicator as needed manually and then saving the complete setup in a workspace file so it could restore properly as you need it the next time you open it.

      Thanks Bertrand. Is there any plan to add the ability to assign z-order values to individual plots or the whole study with NinjaScript?

      I also see this in the documentation:

      Note: Draw objects originating from a NinjaScript indicator or strategy will all generally share the same z-order as the script. To have the objects on a separate z-order would have to be set programmatically.

      It seams to imply that changing the z-order is possible/supported programmatically. Am I missing something?


      Onn
      Last edited by onnb1; 03-27-2012, 09:57 PM.

      Comment


        #18
        Onn, no currently that would not be supported - see the other thread of yours I also just replied to. For the draw objects, you designate if the zorder of creating objects would be the same of the indicator study or if they would be separate, you do not assign a concrete zorder level via code.
        BertrandNinjaTrader Customer Service

        Comment


          #19
          How would you ensure indicators are always ON TOP of price bars?

          Comment


            #20
            Nothing we could support unfortunately, but you can try using a very high ZOrder level.
            BertrandNinjaTrader Customer Service

            Comment


              #21
              There is a non-programmatic way to do this. While on the chart, select the object you want to change the ZOrder / Z-index of then hold down the Shift key while scrolling the mouse-wheel. Unfortunately, it needs to be done every time the chart is re-loaded.

              Would be great if it could be saved as part of the template.

              Comment


                #22
                Hello vlc,

                Upon changing the Z-order of your indicators to your liking, you can definitely save this to a chart template that can be reloaded later with all of your indicators, and their Z-orders, saved.

                To do this, you'll want to right-click on the chart and select Templates -> Save As. Name your template to whatever you like and press OK.

                The next time you create a new chart, you'll be able to load up that same template again by selecting it in the "Load the following Chart Template" section.

                For more information about Chart Templates, please take a look at the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG..._templates.htm

                Please, let us know if we may be of further assistance.
                Zachary G.NinjaTrader Customer Service

                Comment


                  #23
                  I wish that worked for me. Maybe some of my indicators are explicitly setting their ZOrder?

                  Comment


                    #24
                    Hello vlc,

                    Can you please provide a demonstration of the chart template not saving the Z-order settings of your indicators?

                    Here's a simple test you can do:
                    • Create a new chart with your indicators overlayed on top of it and change the Z-Ordering of the indicators.
                    • Save this to a chart template.
                    • Create a new chart with the same template loaded. Change the Z-Ordering around and re-save the template.
                    • Close the new chart. Open another chart, load the template, and compare the older version of your chart template on your previous chart to this new chart with the new version of the template. Has the Z-Ordering changed?
                    Zachary G.NinjaTrader Customer Service

                    Comment


                      #25
                      Need help!
                      I draw shapes on chart using Graphics object.
                      And I cant get my shapes over bars. ZOrder don't work.
                      But it works only one time if I open new chart and place my indicator on it.
                      Next time after open NT all shapes are under bars.

                      Comment


                        #26
                        Hello ren37,

                        Thank you for writing in.

                        As a test, can you please see if you are able to reproduce this with the built-in CustomPlotSample indicator?

                        Ensure that you have added this to a chart with Panel set to Same as input series.

                        Save and shutdown NinjaTrader with this indicator applied. When restarting, do you see the same behavior?
                        Zachary G.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by GMiller64, Today, 01:13 PM
                        3 responses
                        5 views
                        0 likes
                        Last Post GMiller64  
                        Started by itrader46, Today, 12:51 PM
                        4 responses
                        30 views
                        0 likes
                        Last Post itrader46  
                        Started by hemlock, Today, 11:45 AM
                        3 responses
                        9 views
                        0 likes
                        Last Post NinjaTrader_PatrickG  
                        Started by gbulle, Today, 11:31 AM
                        1 response
                        6 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by JPPoulin, Today, 10:43 AM
                        6 responses
                        20 views
                        0 likes
                        Last Post JPPoulin  
                        Working...
                        X