Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZOrder is not persistent

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

    ZOrder is not persistent

    When refreshing a chart via F5, the selected ZOrder for the different indicator plots is not maintained but often inverted.

    I would expect that the indicators on my charts will not change the ZOrder each time that I connect to a datafeed or refresh via F5.

    Currently I need to use Shift + Mousewheel everytime that I have refreshed my chart in order to reestablish the selected ZOrder for each of the indicators.

    #2
    Set.Zorder

    In order to set the ZOrder, I am still using this.ZOrder = N, because SetZOrder(N) did not work.

    For my indicators, it seems that NinjaTrader ignores the selected ZOrder altogether,

    In State.Historical I have set

    for Indicator A: this.ZOrder = -1;
    for Indicator B: this.ZOrder = - 2;

    I have used negative values for both, because I want them to plot behind the chart bars. Actually they do plot behind the chart bars, but indicator B always plots on top of indicator A, although it carries a smaller number for ZOrder.

    Why is this?

    Comment


      #3
      Hello Harry,

      Thanks for your posts on this topic.

      Do you have a sample indicator that I can use to test this and provide to development to demonstrate the issue?

      Or, advise the code used as much as you can and I will try to recreate.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        The issue with the ZOrder is not 100% reproducible, but it can be often observed. It is also linked to the loading time of an indicator.

        The indicators causing problems have custom OnRender() sections that do not call base.OnRender(chartControl, chartScale).

        Attached is an example:

        -> The MultiMACross indicator is set to ZOrder = -1.
        -> The Opening Range indicator is set to ZOrder = -5.

        I have added those indicators to a new chart. My expectation was that the Opening Range indicator plots behind the MACross indicator, but in fact it plots on top of the MA Cross indicator.

        When I refresh via F5, sometimes the Opening Range indicator plots behind and sometimes it plots above the other indicator. This happens without changing the settings. Sometimes it looks like a random event.

        I do not wish to post the open source version of these indicators here, but willing to send them via e-mail, if you wish to check them.
        Attached Files

        Comment


          #5
          Here is a link to a little video.

          I am just selecting the chart and then refreshing via F5.

          After the refresh the outcome is about random. You neve know which of the indicators will be in front and which one will be behind.

          Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.

          Comment


            #6
            Hello Harry,

            Thanks for your replies.

            I will need to create a reproducible condition. Please send the sample indicators to PlatformSupport[at]NinjaTrader[dot]com Mark the subject Atten: Paul and please include a link to this thread for reference.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello Paul,

              Thank you for your help.

              I have sent you the two indicators for further investigation.

              Comment


                #8
                Hello Harry,

                Thanks for sending the indicators. I have recreated.
                We will update this thread when we have further information.
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  I am running into similar issue. Do we have any updates here?

                  Hi,
                  I am running into similar issue. Do we have any updates here?
                  Thanks in Advance

                  Comment


                    #10
                    Hello jmneto,

                    Thank you for your post.

                    Please review the attached example for persisting the Z-Order through compiling and reload of NinjaScript.

                    Please let me know if you have any questions.
                    Attached Files

                    Comment


                      #11
                      From reading the code fragment below, and other information I found here it seems that one need to be constantly setting ZOrder to keep the desired ZOrder. Is that correct?

                      protected override void OnBarUpdate()
                      {
                      ZOrder = _SaveZOrder;
                      Print(ZOrder);
                      }

                      Comment


                        #12
                        Hello jmneto,

                        Thank you for your response.

                        That is correct as we want to ensure the OnBarUpdate call sets the ZOrder to the saved value after the reload.

                        Please let me know if you have any questions.

                        Comment


                          #13
                          Thank you, what is the difference between setting ZOrder property directly and calling SetZOrder() as recommended in your docs https://ninjatrader.com/support/help...ightsub=zorder

                          Comment


                            #14
                            Hello jmneto,

                            Thank you for your response.

                            The example I provided will save the ZOrder where as SetZOrder sets the ZOrder. ZOrder is the level it is at and SetZOrder is to set the order.
                            Please let me know if you have any questions.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Barry Milan, Yesterday, 10:35 PM
                            5 responses
                            16 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Started by DanielSanMartin, Yesterday, 02:37 PM
                            2 responses
                            13 views
                            0 likes
                            Last Post DanielSanMartin  
                            Started by DJ888, 04-16-2024, 06:09 PM
                            4 responses
                            12 views
                            0 likes
                            Last Post DJ888
                            by DJ888
                             
                            Started by terofs, Today, 04:18 PM
                            0 responses
                            11 views
                            0 likes
                            Last Post terofs
                            by terofs
                             
                            Started by nandhumca, Today, 03:41 PM
                            0 responses
                            8 views
                            0 likes
                            Last Post nandhumca  
                            Working...
                            X