• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem in rendering DrawLine/DrawRectangle

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

    Problem in rendering DrawLine/DrawRectangle

    Hi, I am working on a simple indicator which plots certain levels using DrawLine and DrawRectangle based on a static input I provide through a file.

    The DrawLine and DrawRectangle span over the whole calendar day, so I'm using as endTime = startTime.AddDays(1); for the line/rectangle.

    The draw functions are called once in the OBU at the start of every day.

    Everything is working fine, except when I go down to a 1min chart, the lines and rectangles suddenly disappear. If I scroll to the left or right, they are displayed again, and as I scroll horizontally, they seem to go on and off. If I zoom out the 1min, everything is displayed correctly. On the 5min, it works as well.

    This looks like a render problem when I have a zoomed in 1min chart but I can't quite figure it out. Thanks.

    #2
    Update: On the 5-min, if I continue to zoom in (Ctrl+Down), at some point the lines and rectangles disappear. Another zoom level with Ctrl+Down and they appear again. If I keep zooming in and they disappear.

    This is obviously a rendering issue.

    Comment


      #3
      Hello silacitrader,

      Thank you for your post.

      This occurs when the anchor points of the object (beginning and ending points) are outside of the view-able range.

      Objects with greater than or equal to two anchor points can disappear while scrolling when either anchor point is far away from the display range. It is possible to have both anchors off the visible range, but still have the object and as you scroll a little bit then to have the line disappear despite both anchors still being outside the visible range.

      Please let me know if you have any questions.
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        Thank you Patrick, that explains it.

        It's not a big deal, the logic is working fine, but is there any better practice to drawing horizontal lines?

        Thanks

        Comment


          #5
          Hello silacitrader,

          Are you referring to DrawHoriztonalLine()?
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            Hi, no I'm actually referring to DrawLine as lines will be different for any given session/day.

            Comment


              #7
              Hello silacitrader,

              Thank you for your response.
              Originally posted by silacitrader View Post
              is there any better practice to drawing horizontal lines?
              Can you expand upon this inquiry further?
              Patrick H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by ct, Today, 05:31 AM
              0 responses
              1 view
              0 likes
              Last Post ct
              by ct
               
              Started by pstrusi, Today, 02:21 AM
              0 responses
              5 views
              0 likes
              Last Post pstrusi
              by pstrusi
               
              Started by indy73, Yesterday, 10:52 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_EricB  
              Started by priceisking, 05-13-2019, 08:30 AM
              6 responses
              40 views
              0 likes
              Last Post Harry
              by Harry
               
              Started by WgfhqDsdfg, Today, 12:56 AM
              0 responses
              7 views
              0 likes
              Last Post WgfhqDsdfg  
              Working...
              X