Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Extending a box or line (or till break) to the right

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

    Extending a box or line (or till break) to the right

    Hi,

    How do I code a box to extend indefinitely to the right (as with the Ray/F3 drawing in NT)?
    And how do I do this same thing to a line as well?

    And last question...
    How do I extend a line or a box - but only until a candle breaks the line (or box fully, or even partially as a user input option), then the line/box stops there. So historically, there will lots of lines/boxes, and there will be some "naked" lines/boxes that extend forever to the right because price did not break/cross the line/box, and there will be lines that are stopped right at the candle that crossed the line.

    Is there a native Indicator in NT that does this - where I could just check out the code and grab from there within the NinjaScript editor?
    Or do you have any code samples, links to help me program this piece?

    It's the same idea as Fair Value Gaps boxes, support/resistance zones/boxes and key level lines.
    I want to have code to create all these similar concepts. (I don't need an FVG btw, just the example code so I could use it my own way)

    Thanks!

    #2
    Hello Trader4Life,

    Rays are a special case which has logic to render to the edge of the chart panel which is not possible with other objects. To extend any other objects, you need to save the original Current bar index or Time for the start anchor to a variable so that can be reused and then use 0 bars ago as the end bars ago to keep it extending with each new bar. If you wanted to make your own custom tool that extends to the right like a ray, you can reuse the calculations the ray used in its code to extend a point to the panel edge.






    Comment


      #3
      Very cool, thanks Jesse!
      I'll give it a try

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      590 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X