Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw Line with Label

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

    Draw Line with Label

    Hello,

    I actually have two questions about Draw objects:

    1. Is it possible to draw a line segment over the right-most N bars of the chart so that is continually moves as the day progresses? For example, I want to draw a line at a price of 45.50 such that it displays over the last 10 bars, but continues to be extended as the trading day passes.

    My thought for doing this was to use the DrawLine method and, at every bar, remove and redraw the Draw object. This seems inefficient and I wondered if there was a better way.

    2. Can a label or text box be added to the line above so that it always appears at the right-most edge of the Line object?

    Thank you.

    #2
    Hello ivb73077,

    Thank you for your inquiry.

    1. You would be able to call the DrawLine() method call with the same tag and it will modify the previous line for you with your new parameters.

    2. You can use the DrawText() method call to draw text at a particular point specified. What you could do is access the line in the DrawObjects collection and access its parameters for use in your DrawText() as well.

    Please take a look at these links to the NinjaTrader help guide for more information about DrawText() and DrawObjects: http://ninjatrader.com/support/helpG.../?drawtext.htm


    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      This should work. Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      559 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 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
      546 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X