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

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.

      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()?

          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?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Perr0Grande, Today, 08:16 PM
              0 responses
              2 views
              0 likes
              Last Post Perr0Grande  
              Started by elderan, Today, 08:03 PM
              0 responses
              3 views
              0 likes
              Last Post elderan
              by elderan
               
              Started by algospoke, Today, 06:40 PM
              0 responses
              10 views
              0 likes
              Last Post algospoke  
              Started by maybeimnotrader, Today, 05:46 PM
              0 responses
              9 views
              0 likes
              Last Post maybeimnotrader  
              Started by quantismo, Today, 05:13 PM
              0 responses
              7 views
              0 likes
              Last Post quantismo  
              Working...
              X