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 zstheorist, Today, 07:52 PM
          0 responses
          3 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          149 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          5 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          5 views
          0 likes
          Last Post tkaboris  
          Working...
          X