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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        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.
            Chris L.NinjaTrader Customer Service

            Comment


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

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              0 responses
              6 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              11 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              4 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by gentlebenthebear, Today, 01:30 AM
              0 responses
              5 views
              0 likes
              Last Post gentlebenthebear  
              Working...
              X