Announcement

Collapse
No announcement yet.

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.
            http://www.ninjatrader.com/support/f...ad.php?t=39118
            JCNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by max1ci6, Today, 02:02 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by junkone, Yesterday, 08:06 PM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_EricB  
            Started by fscabrera03, Yesterday, 07:27 PM
            1 response
            5 views
            0 likes
            Last Post tradecombine  
            Started by Rad4633, Yesterday, 05:31 PM
            0 responses
            2 views
            0 likes
            Last Post Rad4633
            by Rad4633
             
            Started by litamm89, Yesterday, 03:51 PM
            0 responses
            6 views
            0 likes
            Last Post litamm89  
            Working...
            X