Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

plot vs line priority

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

    plot vs line priority

    I created an indicator but my plot line is under my drawn lines. Is there a way to make the plot line on top of the drawn lines?

    #2
    Hello ballboy11,

    Thank you for the post. You will need to use SetZOrder to set the z-order of your plot to a higher value than the z-order of the lines. You can also set the z-order once the script is running by clicking on the plot to select it, then hold Shift and scroll up or down on your mouse.

    https://ninjatrader.com/support/help...?setzorder.htm - SetZOrder

    Please let me know if I can assist further.

    Comment


      #3
      Thanks I read the info and am still a little confused.

      here are the 2 plots

      AddPlot(new Stroke(eRangeColor, eRangeLineStyle, nLineThickness), PlotStyle.Bar, "A");
      AddPlot(new Stroke(Brushes.Red, eRangeLineStyle, nLineThickness), PlotStyle.Bar, "B");

      I need Plot A on top of Plot B

      Comment


        #4
        Hello ballboy11,

        Thanks for the reply.

        The z-order will be set by the order you call AddPlot. The BuySellVolume indicator adds the DarkCyan plot first, then the red one. If you load it onto the chart you will see that the DarkCyan bar is behind the red bar. So you would need to call AddPlot on B first, then A.

        Please let me know if I can assist further.

        Comment


          #5
          Thanks , I got that workning now but my last challange is to have the plot in front of a Draw.Line()

          Comment


            #6
            Hello ballboy11,

            Thank you for the reply.

            You can change the z-order property if you save your line as a class level variable. Set the z-order to a very large negative number to ensure it will always be in the background.

            Code:
            public class MyIndicator: Indicator
            	{
            		HorizontalLine HZ;
                            ...
                            protected override void OnBarUpdate()
            		{
            			...
            			
            			HZ = Draw.HorizontalLine(this, "MYLINE", (Sells[0]+Buys[0])/2,Brushes.Ivory);
            			HZ.ZOrder = Int16.MinValue;
            		}
            Please let me know if I can assist further.

            Comment


              #7
              Thank you, That is exactly what I was looking for

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              578 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X