Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw vertical line across all panels of chart

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

    Draw vertical line across all panels of chart

    Hi,

    I'm trying to draw a vertical line on a bar within an indicator (given a certain condition) that will go across all panels (from the top to the bottom of the entire chart panel). It looks like that this has to be done from within OnRender. If possible, can you please provide example code for how this can be done?

    Thank you,
    gbrad

    #2
    Hello gbrad, thanks for your post.

    We did figure out how to do this here on this example, but doing this is 100% unsupported since the render area is meant to be clipped to the chart panel by default:

    https://ninjatraderecosystem.com/use...-drawing-tool/

    Please let me know if I can assist any further.

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Comment


      #3
      Hi ChrisL,

      I already looked at this drawing tool before I sent the post. This is exactly what I want to do, but rather than drawing a vertical line using a drawing tool by clicking on the chart, I want to know how this is done within an indicator. How can I modify this piece of code so that it will draw a line given a certain condition within an indicator?

      Thanks very much for your help.

      gbrad

      Comment


        #4
        Hello, thanks for your reply.

        This code is not supported so I will not be able to provide any further insight into it, regrettably.

        Kind regards.

        Comment


          #5
          Okay, I understand. But let me ask this: how do you reference the x and y coordinates of a given bar on the chart?

          Comment


            #6
            Hello, thanks for your reply.

            You can use the following methods to get x,y coordinates on a chart based on the bar, time, and price data:

            https://ninjatrader.com/support/help...etybyvalue.htm
            https://ninjatrader.com/support/help...bybarindex.htm
            https://ninjatrader.com/support/help...getxbytime.htm

            Best regrads.

            Comment


              #7
              This helps. Thanks Chris.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              605 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              351 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              561 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X