Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Extend Line to right

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

    Extend Line to right

    Hi, I will draw Line from my indicator and I want to extend the right from indicator on some condition. How to do that ?

    #2
    Hello nandhumca,

    Thank you for your note.

    You would need to call Draw.Line again if your condition is true using the same tag name and extend the line out using a negative number of bars for the BarsAgo end value.

    I'm attaching a very simple indicator that demonstrates this - if the Extend line box is checked the line will extend 100 bars into the future from the current bar and 10 bars back. If not it will simply be drawn over the last 10 bars.

    If the line isn't a straight horizontal line, you'll need to calculate where the Y value would be before extending the line. Please see the example script, YAxisProjectionOfLine, created by my colleague Paul in post #6 of this forum thread: https://ninjatrader.com/support/forum/forum/ninjatrader-8/add-on-development/107312-price-crossing-a-line#post828663

    Please let us know if we may be of further assistance to you.
    Attached Files

    Comment


      #3
      The above attached script will not work , if the line is standing?

      Comment


        #4
        Hello nandhumca,

        Thank you for your reply.

        I'm not sure what you mean by "if the line is standing"? Can you clarify?

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Sorry there is a typo. It is slanting / angled line. .

          Comment


            #6
            Hello nandhumca,

            Thank you for your reply.

            For that you would need to look at the example script, YAxisProjectionOfLine that I linked in my initial reply to get the y value that would be at the desired extension of the bar and use that for the end Y position when drawing the extended version.

            Please let us know if we may be of further assistance to you.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            333 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
            553 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