Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

draw.line() z-order

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

    draw.line() z-order

    Hi,

    My strategy is drawing a couple of lines on the spot and deletes them, if no more used.

    These lines are automatically placed behind any already existing indicators or bars (i.e. behind a Donchian Channel) and therefore can't be seen.

    I'm searching a kind z-order which I'd like to add to the strategy draw.line method:

    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, DashStyleHelper dashStyle, int width)

    http://ninjatrader.com/support/helpG...rt_objects.htm gives me a hint: Drawing Objects originating from a NinjaScript indicator or strategy will all generally share the same z-order as the script. In this case, the z-order of objects must be changed within the code of the indicator or strategy.

    Unfortunately, I didn't find the code how to do it.

    #2
    Hello enable,

    Thanks for your post.

    Please review the Helpguide link here: http://ninjatrader.com/support/helpG...ratezorder.htm

    To further add to the helpguide example:

    Dot myDot = Draw.Dot(this, "NewDot", true, 5, High[5], Brushes.Black);
    myDot.IsSeparateZOrder = true;
    myDot.ZOrder = 10000;

    Comment


      #3
      Hello Paul,

      Thanks for your support.

      Using the following snippet

      NinjaTrader.NinjaScript.DrawingTools.Line myLine = Draw.Line();
      myLine.IsSeparateZOrder = true;
      myLine.ZOrder = 10000;


      the strategy added line is placed above the bars, but not above the indicators. See screenshot with the black dot and the red line below the blue ma and the white dashed channel.

      I'm wondering if it is possible to move the AddChartIndicator(); parts (in this case ma and donchian channel) behind the Draw.Line() element.
      Attached Files

      Comment


        #4
        Hello enable,

        Thanks for your reply.

        You might try different values for the ZOrder, please see: http://ninjatrader.com/support/helpG...art_zorder.htm

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        29 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        46 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        38 views
        0 likes
        Last Post CarlTrading  
        Working...
        X