• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Branpo, Today, 01:25 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by aslane, Today, 12:47 PM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by HavasuTrader, Today, 12:30 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Started by Boonfly8, Today, 12:20 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by RedDuke, Today, 11:40 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_PatrickG  
          Working...
          X