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 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 helpwanted, Today, 03:06 AM
      1 response
      10 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      9 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      387 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X