Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetZOrder not working as expected

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

    SetZOrder not working as expected

    I'm not sure if this is a bug in my code but converting an indicator from NT7 to NT8. In my NT7 code I would do something like:

    Code:
    protected override void Initialize()
    {
      ...
      ZOrder = ZOrder - 1;
      ...
    And this would cause my drawings in
    Code:
    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    to go underneath the standard bar chart bars.

    However in NT8 I'm now doing:

    Code:
    protected override void OnStateChange()
    {
      ...
      else if (State == State.Active)
      {
        SetZOrder(-1);
      }
    However this seems to have no effect on the things I'm drawing in

    Code:
    protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    Everything I draw goes on top of the bars. How can I get things I draw in OnRender to go under chart bars?

    #2
    Looks like I can get my desired outcome by setting ZOrder property directly in

    Code:
    else if (State == State.Configure)
    {
        ZOrder = -1;
    }
    which I learned about in this thread:
    http://ninjatrader.com/support/forum...ad.php?t=73978

    Comment


      #3
      That is correct. You can think of State.SetDefaults and State.Configure as replacements for Initialize().
      Dave I.NinjaTrader Product Management

      Comment


        #4
        Cool... This works.

        But this doesn't: http://ninjatrader.com/support/helpG.../setzorder.htm

        You might want to fix that when you have time...

        Comment


          #5
          I was able to pin down an issue with ZOrder this morning which may be related, but I will not know for certain until we've resolved the issue that I discovered and tested SetZOrder() once more.
          Dave I.NinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by schmidtbc16, Today, 03:36 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by RT001, Today, 03:25 PM
          2 responses
          12 views
          0 likes
          Last Post RT001
          by RT001
           
          Started by mbrandau, Today, 01:58 PM
          5 responses
          37 views
          0 likes
          Last Post mbrandau  
          Started by remcovdmeulen, Today, 02:15 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Jim  
          Started by gbrad, Today, 09:57 AM
          7 responses
          15 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X