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 charlesugo_1, 05-26-2026, 05:03 PM
              0 responses
              68 views
              0 likes
              Last Post charlesugo_1  
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              151 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              162 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 05-10-2026, 08:12 PM
              0 responses
              100 views
              0 likes
              Last Post CarlTrading  
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              288 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Working...
              X