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

ZOrder problems

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

    ZOrder problems

    Problem 1)
    I have read alot on this problem but cannot seem to resolve this. I am trying to set the ZOrder for my indicator in the Initialize() method but no matter what # I set the variable to, the plots remain behind everything plotted in price pannel.

    Problem 2)
    I am trying to plot a filled circle (opacity = 10) and then plot a number inside the circle, ofcourse on top of the area color.

    What happens is that the numbers visible in only some of the circles in a totaly random order.

    Anyone ever encountered something similar? Any help on this would be greatly appreciated.

    Thanks,

    Pete

    NT V7.0.1000.06

    #2
    Hi Pete,

    Unfortunately it is not currently supported to set the Z-order programatically. One thing you should check is that you have SeparateZOrder = true for the drawing objects you're working with:


    You may be able to look around these forums to see what others have come up with. The only supported technique is manual adjustment.

    To adjust the z-order:

    1. Select the chart object by left mouse clicking on it
    2. Hold down the "Shift" key on your keyboard and roll the mouse scroll wheel to change the z-order of the object. The current position out of the total number of levels in the z-scale will be displayed.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by fx_pete View Post
      Problem 1)
      I have read alot on this problem but cannot seem to resolve this. I am trying to set the ZOrder for my indicator in the Initialize() method but no matter what # I set the variable to, the plots remain behind everything plotted in price pannel.

      Problem 2)
      I am trying to plot a filled circle (opacity = 10) and then plot a number inside the circle, ofcourse on top of the area color.

      What happens is that the numbers visible in only some of the circles in a totaly random order.

      Anyone ever encountered something similar? Any help on this would be greatly appreciated.

      Thanks,

      Pete

      NT V7.0.1000.06
      What statement are you using, and where ?

      Comment


        #4
        re: ZOrder problems

        Thanks ryanM for the suggestions ...

        did not work though, but I'll find a way around it. Just wondering if this will ever be supported as it seems like a important feature to be able to programmaticaly control the z-order of every object that is plotted. Keeping track of objects' z-order doesn't sound so hard but then again I am not that familiar with the architecture and implemenation of NT to really know the answer.

        Setting the object's z-order to -1 sounds like a really good way to avoid all the problems with keeping track of zorder but that it would have to actually work.

        Correct me if I am wrong but this (bring to front) is the intended objective of setting ZOrder = -1; in Initialize() right?


        Originally posted by koganam View Post
        What statement are you using, and where ?
        I have tried a couple of combinations ...

        ZOrder = -1 or 0 or 1; in Initialize() or setting ZOrder in OnBarUpdate() just before or after I make the plots and I have tried setting SeparateZOrder = true for the ellipse that I am drawing and then resetting ZOrder.

        But something tells me that there is a bug that needs to be fixed somewhere, though whether that includes my brain, I cant tell

        Thanks for you help guys ...

        Comment


          #5
          Originally posted by fx_pete View Post
          I have tried a couple of combinations ...

          ZOrder = -1 or 0 or 1; in Initialize() or setting ZOrder in OnBarUpdate() just before or after I make the plots and I have tried setting SeparateZOrder = true for the ellipse that I am drawing and then resetting ZOrder.

          But something tells me that there is a bug that needs to be fixed somewhere, though whether that includes my brain, I cant tell

          Thanks for you help guys ...
          If you want the plot to be in front of the prices, try:

          Code:
          ZOrder = 100;
          in the Initialize() section. You must put the ZOrder high enough that it will be greater than all the objects that you anticipate you will be drawing on the chart. a really high number just pretty much guarantees that the indicator objects will be above everything else, no matter what order it is loaded.

          Comment


            #6
            Thanks Koganam. The suggestion to programatically set Z order is tracked with id # 295.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by koganam View Post
              If you want the plot to be in front of the prices, try:

              Code:
              ZOrder = 100;
              in the Initialize() section. You must put the ZOrder high enough that it will be greater than all the objects that you anticipate you will be drawing on the chart. a really high number just pretty much guarantees that the indicator objects will be above everything else, no matter what order it is loaded.
              Thanks for your suggestion but unfortunatelly I have tried that and no matter what value (high or low) I set ZOrder to it does not affect what is displayed.

              Comment


                #8
                Originally posted by fx_pete View Post
                Thanks for your suggestion but unfortunatelly I have tried that and no matter what value (high or low) I set ZOrder to it does not affect what is displayed.

                That is strange, unless it got broken in the most recent update. I guess I will have to take a closer look at my indicators that use it then. If I can free some cycles, I will post some demo code, or else confirm what you are saying.

                Comment


                  #9
                  I can confirm this, it makes no difference what numbers you use, objects seem to go where they want. Thanks for placing this in the list, support, as it is badly needed.

                  Dan
                  eDanny
                  NinjaTrader Ecosystem Vendor - Integrity Traders

                  Comment


                    #10
                    Originally posted by eDanny View Post
                    I can confirm this, it makes no difference what numbers you use, objects seem to go where they want. Thanks for placing this in the list, support, as it is badly needed.

                    Dan
                    I have finally had some time to go back to my indicator and look at this again. I can confirm absolutely that specifying the Z-order in the Initialize() method does affect the relative (to price) position depth of objects drawn by the indicator.

                    Pictures attached. Clearly a Z-Order = -1 draws behind the bars; Z-Order = 100 draws in front of the bars.
                    Attached Files
                    Last edited by koganam; 07-15-2011, 02:19 PM.

                    Comment


                      #11
                      Originally posted by koganam View Post
                      I have finally had some time to go back to my indicator and look at this again. I can confirm absolutely that specifying the Z-order in the Initialize() method does affect the relative (to price) position depth of objects drawn by the indicator.

                      Pictures attached. Clearly a Z-Order = -1 draws behind the bars; Z-Order = 100 draws in front of the bars.
                      Thanks for the confirmation ....

                      Now I am stuck in trying to figure out why it works for you and not for me ...
                      -> can you please show me how excactly does your initialize() function look?

                      Can anyone else confirm this?

                      Thanks
                      Last edited by fx_pete; 07-17-2011, 04:28 PM. Reason: new info

                      Comment


                        #12
                        Originally posted by fx_pete View Post
                        Thanks for the confirmation ....

                        Now I am stuck in trying to figure out why it works for you and not for me ...
                        -> can you please show me how excactly does your initialize() function look?

                        Can anyone else confirm this?

                        Thanks
                        Nothing fancy. Here is the entire Initialize() method. Obviously some of the terms are irrelevant, but I deliberately did not pick and choose.


                        Code:
                                protected override void Initialize()
                                {
                        //            Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
                                    Overlay				= true;
                        			PriceTypeSupported	= false;
                        			AutoScale			= false;
                        			BarsRequired		= 2;
                        			CalculateOnBarClose	= true;
                        			this.ZOrder = -1;
                        			
                         			AllowRemovalOfDrawObjects = true; // Draw objects can be removed separately from the script
                         
                        			this._insRangeInTicks = new IntSeries(this);
                        			
                        			this._rpZone1Rect	= new RectParams();
                        			this._rpZone2Rect	= new RectParams();
                        			this._rpZone3Rect	= new RectParams();
                        		}

                        Comment


                          #13
                          Thank you for this thread...I was going CraZy trying to get some control on the zorder or draw index or level (what ever you want to call it). Even the shift-control-click-wheel spin was not working right... the plot would not maintain the setting when a new bar plotted.

                          I was able to do what I wanted using what is listed in this thread.

                          I had tried a number of other suggestions and my code had remnants of those attempts throughout and I cleared all those out first

                          I then simply put

                          this.ZOrder = 100;

                          in the initialize and the indicator began to draw on-top of everything.

                          I make use of chart templates using this indicator. I know this may sound weird, but it works....With a chart displayed, using one of these templates, I first deleted the indicator from the chart, then restored the respective template. I then did 1 more shift-click-control-wheel action to get the indicator to the desired location I wanted. I then saved the template again. Here is the weird part, do a refresh, then reload the just saved template. After this my chart will refreshe, view change and draw new bars without altering the draw order. I needed to reload the saved template for it to maintain the desired draw order.
                          Last edited by tulanch; 10-15-2012, 10:26 PM.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by yertle, Today, 08:38 AM
                          6 responses
                          25 views
                          0 likes
                          Last Post ryjoga
                          by ryjoga
                           
                          Started by algospoke, Yesterday, 06:40 PM
                          2 responses
                          24 views
                          0 likes
                          Last Post algospoke  
                          Started by ghoul, Today, 06:02 PM
                          3 responses
                          16 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by jeronymite, 04-12-2024, 04:26 PM
                          3 responses
                          46 views
                          0 likes
                          Last Post jeronymite  
                          Started by Barry Milan, Yesterday, 10:35 PM
                          7 responses
                          23 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Working...
                          X