Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZOrderType is not always working

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

    ZOrderType is not always working

    Hello,

    I would like my custom drawings tools to be drawn behind bars so I set
    Code:
    ZOrderType[COLOR=#ffffff] [/COLOR]= DrawingToolZOrder.AlwaysDrawnFirst;
    inside
    Code:
    State.SetDefaults
    but I noticed it doesn't work for all my drawing tools. So I tried this on
    Code:
    @Lines.cs
    and indeed it doesn't work for Line, ArrowLine and Horizontal Line but it works for Ray, Extended Line and Vertical Line.

    Do you know what's happening here? Thanks

    #2
    Hello beobast,

    Do you have a sample drawing object where you see this happening that you can attach? I tried the following and see this drawing behind the bars when I draw it. Are there other steps required to see it not drawn first?

    Code:
    namespace NinjaTrader.NinjaScript.DrawingTools
    {
    public class TestLine : Line
    {
        protected override void OnStateChange()
       {
          base.OnStateChange();
          if (State == State.SetDefaults)
          {
             LineType = ChartLineType.ArrowLine;
             Name = "ElLine";
             ZOrderType= DrawingToolZOrder.AlwaysDrawnFirst;
          }
       }
    }
    }
    marcus2300, is your problem specifically related to using AlwaysDrawnFirst in your custom drawing object? If this relates to the series and not specifically a custom drawing object using AlwaysDrawnFirst I would suggest making a new post or use the post you linked so we can assist you with that separately.


    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X