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

BarNumber Side of window

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

    BarNumber Side of window

    I am drawing a rectangle that starts at the bar xxx and ends at the bar yyy which are outside of the current visible window displaying my chart.
    If I scroll to the right then the bar yyy ot back to the bar xxx then the bar is calculated and the rectangle ges drawn.
    As result the rectangle does not show up until I scroll horizontally the chart to that bar right and back to where I was. This forces me to a continuous scrolling back and forth.
    Maybe I can resolve the problem by forcing the drawing of the rectangle just to the visible bar to the chart of the window.
    Is that a way to find out which are the bar numbers at the right and left of the visible screen?
    Or is there an intelligent way to resolve the issue?
    Thank You
    G
    Last edited by giogio1; 01-28-2019, 03:00 PM.

    #2
    Hello giogio1,

    Thanks for your post.

    I would suggest drawing the rectangle to the bar index of 0 which is either the last finished bar or the currently forming bar (depending on the setting of CalculateOnBarClose = false.



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      I would draw 2 rays, one for xxx and one for yyy then you can always see them no matter where.

      Comment


        #4
        Thank for your replies!
        I can't use the ray because my drawings are conditional to what is happening at the right most and left most bars visible on the window. The bar 0 might resolve the problem for the right side.

        I realize that the best solution is really to find out what is the barnumber of the right and left side visible on the window showing the chart.
        I recall there was a way to get the information..but I can' recall.
        Any idea?

        Comment


          #5
          I found something previously posted on the forum that might resolve it. I'll work from these links and see if they actually resolve it.


          Comment


            #6
            Hello giogio1,

            Thanks for your reply.

            I just wanted to mention that in NT7 it is a known bug characteristic that when you draw outside the visible boundaries of the chart, the draw object may or may not display and does relate to scrolling one way or the other as that brings the objects anchor point (one side or the other) into view. This is why drawing to the current bar in NT7 should keep the object visible.

            This will not be changed in NT7 but is not an issue in NT8.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Thank you for the alert !
              Best

              Comment


                #8
                Hello mina9000,

                Thanks for your post.

                My apologies as I am not able to follow what your question is.

                Can you restate in another way and provide a screenshot to illustrate the question(s) you have?
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by CortexZenUSA, Today, 12:53 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by CortexZenUSA, Today, 12:46 AM
                0 responses
                1 view
                0 likes
                Last Post CortexZenUSA  
                Started by usazencortex, Today, 12:43 AM
                0 responses
                5 views
                0 likes
                Last Post usazencortex  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                168 responses
                2,266 views
                0 likes
                Last Post sidlercom80  
                Started by Barry Milan, Yesterday, 10:35 PM
                3 responses
                13 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Working...
                X