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:

    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 ETFVoyageur, Today, 04:00 PM
          0 responses
          5 views
          0 likes
          Last Post ETFVoyageur  
          Started by AaronKTradingForum, Today, 03:44 PM
          1 response
          6 views
          0 likes
          Last Post AaronKTradingForum  
          Started by Felix Reichert, 04-26-2024, 02:12 PM
          11 responses
          76 views
          0 likes
          Last Post Felix Reichert  
          Started by junkone, 04-28-2024, 02:19 PM
          7 responses
          82 views
          1 like
          Last Post junkone
          by junkone
           
          Started by pechtri, 06-22-2023, 02:31 AM
          11 responses
          136 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Working...
          X