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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        64 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        139 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X