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.VerticalLine on 10th bar to the right (updates every bar)

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

    Draw.VerticalLine on 10th bar to the right (updates every bar)

    Hello, Can you help me with a code that draws vertical line on the 10th bar to the right (barsAgo = 9), and updates every bar, that means, that on each OnBarUpdate, previous vertical line is deleted and new line is drawn.

    #2
    Hello UltraNix,

    Thanks for your post.

    You could use Draw.VerticalLine() to draw a vertical line on the chart at a specified bar.

    See the sample code in the help guide documentation linked below which demonstrates drawing a vertical line using a barsAgo value of 10.

    Draw.VerticalLine(): https://ninjatrader.com/support/help...rticalline.htm

    If you would like to use a barsAgo value of 9, you would simply set that for your barsAgo argument when calling the Draw.VerticalLine() method.

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      It draws over chart candles. Is there a way to draw a line "under" (I mean that candles are in foreground, and line is in the background)?

      Comment


        #4
        Hello UltraNIX,

        Thanks for your note.

        You could use SetZOrder() to determine the index in which chart objects are drawn on the chart's Z-axis (front to back ordering). Objects with a higher ZOrder are drawn first.

        See the attached example script demonstrating this.

        And, see this help guide page for more information about SetZOrder(): https://ninjatrader.com/support/help.../setzorder.htm

        Let us know if we may assist further.
        Attached Files
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Thanks, NinjaTrader_BrandonH your help was spot on!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by knowmad, Today, 03:52 AM
          0 responses
          17 views
          0 likes
          Last Post knowmad
          by knowmad
           
          Started by tradingnasdaqprueba, Today, 03:42 AM
          0 responses
          12 views
          0 likes
          Last Post tradingnasdaqprueba  
          Started by Haiasi, 04-25-2024, 06:53 PM
          4 responses
          63 views
          0 likes
          Last Post effraenk  
          Started by ccbiasi, 11-23-2017, 06:06 AM
          5 responses
          2,213 views
          0 likes
          Last Post leodavis  
          Started by kujista, Yesterday, 12:39 AM
          2 responses
          14 views
          0 likes
          Last Post kujista
          by kujista
           
          Working...
          X