• 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

zOrder, Putting Indicators behind Price.

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

    zOrder, Putting Indicators behind Price.

    I'd like my indicators to draw behind the Price bars & not in front.
    Is there a way to set this?

    NB: I do understand that the order I draw my indicators will implicitly set the zOrder. Similarly if I override the PLOT method the order that I use the graphics.Fill & graphics.Draw will also be "last drawn goes on top".

    #2
    David, welcome to the forums, zOrder support will be added with our upcoming NinjaTrader 7 version - http://www.ninjatrader.com/webnew/NT7/NinjaTrader7.html

    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.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, can we control ZOrder programmatically in NT7 with our indicators?
      Last edited by jdfagan; 12-16-2009, 02:45 PM.

      Comment


        #4
        A single indicator has only one zorder. Any objects drawn from the indicator share the same z-order stacking as the indicator itself.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Understood, I want to control ZOrder amongst many indicators living on same Chart Panel via code.

          For example, using your StrategyPlot capability from a strategy, I can add and control many indicators for that strategy. Using the ZOrder property (e.g., StrategyPlot(0).ZOrder) doesn't seem to work). Only way I can control is by order of when I add an indicator - last one added seems to have top-most ZOrder.
          Last edited by jdfagan; 12-16-2009, 02:45 PM.

          Comment


            #6
            Right. Unfortunately you cant control it by code other than the order in which you are adding it.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              When an indicator draws a trendline, that trendline is always painted UNDER the price bars.

              What do we use (programmatically) to push those drawn trendlines to ride on top of the price bars?

              Thanks,
              Ben

              Comment


                #8
                Ben, in NT7 you can control the ZOrder of the drawn objects by the SeparateZOrder property.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  I see that in the ILine...but the SeparateZOrder property is a boolean value. I assume once you set it to true (meaning you want to separate the ZOrder of that element)...you then have to set the ZOrder numerically (somehow) so that it rides on top of the chart bars?

                  Comment


                    #10
                    Ben, you can't set it programmatically - setting this property to true allows you to control the ZOrder of the draw object then manually, see my attached example.
                    Attached Files
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Ok...thanks for the info. So once the line is drawn to the chart (and programmatically set SeparateZOrder = true), then the user will be able to manually change the ZOrder via the scroll-wheel interface.

                      That answers my question! Thanks again

                      Comment


                        #12
                        Originally posted by sbgtrading View Post
                        ...So once the line is drawn to the chart (and programmatically set SeparateZOrder = true), then the user will be able to manually change the ZOrder via the scroll-wheel interface.
                        Yes, exactly - you open the line's ZOrder up to be independent from the applied indicator, thus it gets it's own ZOrder level on the chart.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Are you saying that it will be impossible to programmatically control whether my indicator will be blotted out by price candles? Please find a fix for this as it would be nonsense trying to tell users/customers to manually adjust after applying an indicator to a chart! The end result needs to be user friendly as the very least. Thanks for any consideration.
                          eDanny
                          NinjaTrader Ecosystem Vendor - Integrity Traders

                          Comment


                            #14
                            ZOrder and Chart Templates

                            Just have a few questions:

                            (1) ZOrder can be used in the Initialize section of an indicator. What values can ZOrder take? If I set ZOrder = -1, will this draw my indicator behind the candles? What happens if two indicators use ZOrder = -1?

                            (2) I understand that I can separate the ZOrder of different draw objects within an indicator as per post #10 below.

                            (3) I understand that a workspace saves the ZOrder manually selected, have tested this -> ok.

                            (4) However, I found that a chart template will not save the ZOrder. To solve this issue, two solutions are possible

                            - modify NT7 to include ZOrder with chart templates
                            - hardcode the ZOrder within the indicator

                            This comes back to the first question. Can I attach different values for ZOrder in the Initialize() section of an indicator to define the plot order?

                            Comment


                              #15
                              Harry, unfortunately setting the direct ZOrder level programmatically is not supported. To avoid conflicting ZOrder level settings, we would advise adjusting your layout as needed and then saving this in a workspace.
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ralett, Today, 06:20 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post ralett
                              by ralett
                               
                              Started by grizzlytrader, Today, 06:24 AM
                              1 response
                              18 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by andrewtrades, Today, 01:43 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by FuturesRon, Today, 03:09 AM
                              1 response
                              18 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Ivantr, Today, 05:24 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post Ivantr
                              by Ivantr
                               
                              Working...
                              X