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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X