Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Drawing Rectangle question

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

    Drawing Rectangle question

    Hello,

    I have an indicator which draws rectangles from signal bars to the current bar (bar 0). The rectangle objects are held in a collection, and on each bar update, the rectangles redraw so that they all update to the current bar.

    IF the signal bar, where a rectangle starts from, is viewable on the chart, then the rectangle will plot correctly. However, when the signal bar gets old enough so that it is no longer viewable, then the rectangles don't project to the future.

    The rectangle is somehow there, because if I make the chart big enough or compressed enough to include the starting point of the rectangle (the signal bar) then the rectangle once again plots correctly.

    I'm tearing my hair out trying to figure out how to correct this. Any ideas?

    #2
    Hello coolmoss,

    Do you experience the same issue when using something like DrawDot()?

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Hi JC,

      This type of problem couldn't occur with DrawDot (or other one bar things like arrows or diamonds) because they only plot on one bar. To better describe, imagine doing this: you have a chart open with my indicator and it has a rectangle plotted starting at some bar near the left and extending all the way to the right.

      Now... expand the bar spacing until the bar where the rectangle starts goes off the viewable area (but the vertical position of that bar doesn't change). Once you do that, the rectangle completely disappears.

      I'm sure you can see the problem: I depend on seeing these rectangles drawn to the current bar so I don't have to have the whole data series showing, but it seems like the rectangle will only draw based on the data series being DISPLAYED... as opposed to being drawn based on all the data LOADED.

      Comment


        #4
        Hello coolmoss,

        Thanks for the information.

        Could you post a snippet of how you are calling and accessing the draw methods so that I may look into this?
        JCNinjaTrader Customer Service

        Comment


          #5
          Originally posted by coolmoss View Post
          Hi JC,

          This type of problem couldn't occur with DrawDot (or other one bar things like arrows or diamonds) because they only plot on one bar. To better describe, imagine doing this: you have a chart open with my indicator and it has a rectangle plotted starting at some bar near the left and extending all the way to the right.

          Now... expand the bar spacing until the bar where the rectangle starts goes off the viewable area (but the vertical position of that bar doesn't change). Once you do that, the rectangle completely disappears.

          I'm sure you can see the problem: I depend on seeing these rectangles drawn to the current bar so I don't have to have the whole data series showing, but it seems like the rectangle will only draw based on the data series being DISPLAYED... as opposed to being drawn based on all the data LOADED.
          I seem to remember that that is the situation for all draw object: the initial anchor point must be displayed or the DrawObject is not displayed?

          Comment


            #6
            Hello coolmoss,

            What koganam stated can be the case that you are running into. It is in kind of a specific limitation on when a drawing object with 2 or more anchor points has the anchor points far away from the display range.

            I was trying to verify this by how you are placing your objects.

            The following thread will go over this in more detail if you would like to read it.
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by trilliantrader, Today, 08:16 AM
            2 responses
            6 views
            0 likes
            Last Post trilliantrader  
            Started by samish18, Today, 08:31 AM
            1 response
            1 view
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by Creamers, 09-08-2023, 10:26 AM
            6 responses
            157 views
            0 likes
            Last Post JonyGurt  
            Started by funk10101, Today, 08:14 AM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by bill2023, Yesterday, 08:51 AM
            3 responses
            22 views
            0 likes
            Last Post bltdavid  
            Working...
            X