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

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, 10: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 algospoke, Yesterday, 06:40 PM
                        2 responses
                        20 views
                        0 likes
                        Last Post algospoke  
                        Started by ghoul, Today, 06:02 PM
                        3 responses
                        14 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by jeronymite, 04-12-2024, 04:26 PM
                        3 responses
                        45 views
                        0 likes
                        Last Post jeronymite  
                        Started by Barry Milan, Yesterday, 10:35 PM
                        7 responses
                        21 views
                        0 likes
                        Last Post NinjaTrader_Manfred  
                        Started by AttiM, 02-14-2024, 05:20 PM
                        10 responses
                        181 views
                        0 likes
                        Last Post jeronymite  
                        Working...
                        X