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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        22 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X