Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZOrder issue NT. 8.0.1.0

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

    ZOrder issue NT. 8.0.1.0

    I have an indicator which has the ZOrder set to '- 1' and uses Draw.Region() to draw a shaded area on the price panel. The indicator does not use a custom plot.

    Code:
    if (State == State.Historical)
    {
        SetZOrder(-1);
    }
    When I apply that indicator to the price panel, everything works as expected and the indicator plots behind the price bars.

    However, when I apply that indicator to a secondary panel, the indicator plots do not show but NinjaTrader throws an error message "Failed to call OnRender for 'indicator'. 'Sequence contains no elements'. Draw.Region shades the price panel as expected, while the secondary panel remains empty.

    The problem only occurs, when both ZOrder is set to a negative value and DrawOnPricePanel is set to 'true' (or not set at all). No problem when either ZOrder is zero/positive or DrawOnPricePanel is set to 'false'.

    Nota: I have used SetZOrder within State.SetDefaults. The new user manual suggests to use it within State.Historical. Why is that? The bug occurs in both cases.

    #2
    Originally posted by Harry View Post
    However, when I apply that indicator to a secondary panel, the indicator plots do not show but NinjaTrader throws an error message "Failed to call OnRender for 'indicator'. 'Sequence contains no elements'. Draw.Region shades the price panel as expected, while the secondary panel remains empty.

    The problem only occurs, when both ZOrder is set to a negative value and DrawOnPricePanel is set to 'true' (or not set at all). No problem when either ZOrder is zero/positive or DrawOnPricePanel is set to 'false'..
    I'm using
    Code:
     this.Zorder = -1;
    in State Configure and using
    Code:
     DrawOnPricePanel = true;
    in State.Default and am Not experiencing that same issue..





    Attached Files
    -=Edge=-
    NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

    Comment


      #3
      Thanks. We are looking into that scenario further for the next release - #10787

      For your question:

      Originally posted by Harry View Post
      The new user manual suggests to use it within State.Historical. Why is that? The bug occurs in both cases.
      Set ZOrder() checks the current z-order of all other chart objects in that panel, and then sets the desired value relative to the other objects. Those other chart objects may not exist until at least State.Historical, so it is best to wait to ensure that your desired level is not conflicting with a chart object.
      MatthewNinjaTrader Product Management

      Comment


        #4
        Originally posted by NinjaTrader_Matthew View Post
        Set ZOrder() checks the current z-order of all other chart objects in that panel, and then sets the desired value relative to the other objects. Those other chart objects may not exist until at least State.Historical, so it is best to wait to ensure that your desired level is not conflicting with a chart object.
        Matthew, with that, are you saying that

        SetZorder() is recommended over Zorder =

        and that this should not be done before State.Historical?

        I think I remember having to play around with this in earlier beta's and what I posted above seemed to work.. at least so far, but if there is now a recommended technique, over what I'm currently using, than I do want to adopt that..


        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          Originally posted by -=Edge=- View Post
          Matthew, with that, are you saying that

          SetZorder() is recommended over Zorder =

          and that this should not be done before State.Historical?

          I think I remember having to play around with this in earlier beta's and what I posted above seemed to work.. at least so far, but if there is now a recommended technique, over what I'm currently using, than I do want to adopt that..


          You can use the ZOrder property setter, but it can cause conflicts as it's possible then for two chart objects to share the same ZOrder. This can be a problem if a user is e.g., manually modifying the ChartBars ZOrder and it now shares your chart objects ZOrder.

          Using SetZOrder() during the initial load protects against this scenario since it doesn't set to a particular ZOrder, but instead a relative ZOrder.
          MatthewNinjaTrader Product Management

          Comment


            #6
            Originally posted by NinjaTrader_Matthew View Post
            Thanks. We are looking into that scenario further for the next release - #10787.

            The observation made by @Edge is correct. The problem only occurs when SetZOrder(-N) is used in conjunction with DrawOnPricePanel = true.

            When 'SetZOrder(-N);' is replaced with 'this.ZOrder = -N;',there is no problem.

            It seems that SetZOrder() cannot handle negative values, when the indicator is placed on a secondary panel and DrawOnPricePanel is set to 'true'.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kevinenergy, 02-17-2023, 12:42 PM
            123 responses
            2,883 views
            1 like
            Last Post SilverSurfer1  
            Started by warpinator, Yesterday, 10:44 AM
            2 responses
            19 views
            0 likes
            Last Post warpinator  
            Started by rayyyu12, Today, 03:59 PM
            0 responses
            10 views
            0 likes
            Last Post rayyyu12  
            Started by calmcosmia, Today, 03:07 PM
            4 responses
            14 views
            0 likes
            Last Post calmcosmia  
            Started by Tim-c, Today, 02:34 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X