Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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;
    Paul H.NinjaTrader Customer Service

    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
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by AttiM, 02-14-2024, 05:20 PM
        12 responses
        213 views
        0 likes
        Last Post DrakeiJosh  
        Started by cre8able, 02-11-2023, 05:43 PM
        3 responses
        238 views
        0 likes
        Last Post rhubear
        by rhubear
         
        Started by frslvr, 04-11-2024, 07:26 AM
        8 responses
        117 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        10 responses
        47 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by rocketman7, Today, 09:41 AM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X