Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Objects Dynamically

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

    Drawing Objects Dynamically

    Hi,

    Due to a session template of default 24/7 and some prints occuring afterhours I'm finding my objects, specifically triangles, are squished when reloading a chart the next day. The anchor points are the same for the triangle but they're at different points on the chart's future now that a day has passed. There is no problem to the left of the current bar as that stays static but to the right of the current bar changes when a day has passed.

    Is there anyway to draw the triangles dynamically, based on the current bar so I can keep them on the chart when it reloads the next day?

    #2
    Hello stockgoblin,

    Thank you for your post.

    Are these Drawing Objects you have manually drawn or drawn from an indicator or strategy?

    Is the Equidistant Bar Spacing set to True or False? You can check this by right clicking in your chart > select Properties.

    In addition, please attach any screenshots of this item on your charts to your response so I may investigate this matter further.

    I look forward to your response.

    Comment


      #3
      I draw manually drawn triangle on my charts. The one's that go to the right of the current bar get squashed when I reload the chart the next day. I have to use session template default 24/7 as I never know if there are going to be afterhours prints or not.

      Equidistant Bar Spacing is set to True

      please see attached image - I don't have a before picture but you can see where the triangles switch to squished.
      Attached Files

      Comment


        #4
        Hello stockgoblin,

        Thank you for your response.

        I am unable to recreate this item on my end.

        Please send me your workspace files so I may test this item on my end.

        You can do this by going to the Control Center-> Help-> Mail to Support-> ensure the Workspace files option is enabled.

        Please place 'ATTN: Patrick' in the subject line and reference this thread in the body of the e-mail: http://www.ninjatrader.com/support/f...ad.php?t=56004

        I look forward to assisting you further.

        Comment


          #5
          Well, yea. I just told you it happens when you reload the chart the next day. So open a new chart with default 24/7 session and draw triangles all over the place, to the right and left of the current bar. SAVE IT, WAIT ONE DAY, and then reload it.

          you don't need my workspaces, it's simple.

          Comment


            #6
            Hello stockgoblin,

            Thank you for that clarification.

            I will follow up with you tomorrow on this matter.

            Comment


              #7
              Originally posted by stockgoblin View Post
              Well, yea. I just told you it happens when you reload the chart the next day. So open a new chart with default 24/7 session and draw triangles all over the place, to the right and left of the current bar. SAVE IT, WAIT ONE DAY, and then reload it.

              you don't need my workspaces, it's simple.
              stockgoblin, I thought that we had already had this conversation some time last year?

              ref: http://www.ninjatrader.com/support/f...ad.php?t=52592

              Comment


                #8
                Yea, I haven't been able to find a suitable work around. Your suggestion of using DrawTriangle() would still not work.

                The Daily and Weekly charts work fine. The Triangles I manually draw on them to the right of the currentbar stay put on reloading. This is because there's no afterhours data on these charts. It's the damn 60 minute chart where everything goes to hell. I have to use 24/7 because of afterhours prints and that means on reloading the next day the right side of the chart past the currentbar has different times assigned than it did the day before when I saved my workspace. This causes the anchor points to be in different places even though they are the same times & numbers.

                I don't think there is a solution.

                It's just the way the charts are constructed with afterhours data some hours and sometimes not.

                I tried using a custom session template from 5 a.m. - 8 p.m. but this only helps a little bit and I did notice on switching back to 24/7 that the data was represented differently.

                They'd have to drastically change how they assign the time signatures to the right of the currentbar on intraday charts.

                I just thought I'd bring it up again and see if any progress could be made.

                Comment


                  #9
                  Originally posted by stockgoblin View Post
                  Yea, I haven't been able to find a suitable work around. Your suggestion of using DrawTriangle() would still not work.

                  The Daily and Weekly charts work fine. The Triangles I manually draw on them to the right of the currentbar stay put on reloading. This is because there's no afterhours data on these charts. It's the damn 60 minute chart where everything goes to hell. I have to use 24/7 because of afterhours prints and that means on reloading the next day the right side of the chart past the currentbar has different times assigned than it did the day before when I saved my workspace. This causes the anchor points to be in different places even though they are the same times & numbers.

                  I don't think there is a solution.

                  It's just the way the charts are constructed with afterhours data some hours and sometimes not.

                  I tried using a custom session template from 5 a.m. - 8 p.m. but this only helps a little bit and I did notice on switching back to 24/7 that the data was represented differently.

                  They'd have to drastically change how they assign the time signatures to the right of the currentbar on intraday charts.

                  I just thought I'd bring it up again and see if any progress could be made.
                  I doubt that any such thing will be done. There are many, I would venture to say, most, who do not want their drawings moving after they draw them. If you want yours to move, then you will have to program them to move.

                  Comment


                    #10
                    Uh, no I don't want them to move. That's the whole point. I want them to stay put. The next morning, they've moved and I have to redo them all.

                    Comment


                      #11
                      Originally posted by stockgoblin View Post
                      Uh, no I don't want them to move. That's the whole point. I want them to stay put. The next morning, they've moved and I have to redo them all.
                      No, it is the chart prices that have moved, not your DrawObject. It looks like a quibble, as there is no doubt relative movement between your DrawObject and the price bars, but we still have to look at the reality. Your DrawObject anchors are exactly where you placed them relative to the ChartPanel, so the DrawObject is exactly as originally drawn, and is therefore, invariant, and cannot have moved. What you are seeking is for the DrawObject anchors to move with the price bars.

                      The only real frame of reference is the Chart Panel. Extension of time and price moves from left to right, so fixed anchors can only be measured from left to right. The reason you keep thinking that your object has moved, it because you are trying to measure it from right to left. IOW, your frame of reference is moving, so your object appears to have moved, when in reality you need to have a fixed frame of reference, relative to which the DrawObject is static.

                      Comment


                        #12
                        Okay, Yes I agree the anchors stay the same values, but what I think you don't understand is on a 60 minute chart with default 24/7 session template there are afterhours slots for 4-5 pm, 5-6, 7-8, 9-10, 11-12, 12-1am, 1-2am,... and when the chart is loaded the next day, if there weren't any prints in those hour slots then they are removed from the chart and if there were any anchor points in those slots then they get shifted to the earliest slot with a data print, thus screwing up the triangle I drew.

                        Comment


                          #13
                          Originally posted by stockgoblin View Post
                          Okay, Yes I agree the anchors stay the same values, but what I think you don't understand is on a 60 minute chart with default 24/7 session template there are afterhours slots for 4-5 pm, 5-6, 7-8, 9-10, 11-12, 12-1am, 1-2am,... and when the chart is loaded the next day, if there weren't any prints in those hour slots then they are removed from the chart and if there were any anchor points in those slots then they get shifted to the earliest slot with a data print, thus screwing up the triangle I drew.
                          In that case I stand corrected. When I look at the properties of the Triangle DrawObject, the anchors are specified in DateTime values. I agree that if they are fixed in DateTime values, then they should not shift, whether or not there are bars where the anchor points are. IOW, if the actual anchor point changes its DateTime value, then the object has moved, and I would consider it to be a bug. Given what you describe, it would seem that DataTimes are being processed relative to bars, instead of bars relative to DateTime.
                          Last edited by koganam; 04-22-2013, 01:48 AM. Reason: Corrected grammar.

                          Comment


                            #14
                            Yes, excellent, I think you just summed up the problem in a way I couldn't seem to phrase properly. Thank you. Hopefully development can ponder that.

                            Comment


                              #15
                              Hello stockgoblin and koganam,

                              Thank you for your notes here.

                              The charts in NinjaTrader are time based and what you are seeing is expected behavior. I will forward this to our development team.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by JoMoon2024, Today, 06:56 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post JoMoon2024  
                              Started by Haiasi, 04-25-2024, 06:53 PM
                              2 responses
                              17 views
                              0 likes
                              Last Post Massinisa  
                              Started by Creamers, Today, 05:32 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Creamers  
                              Started by Segwin, 05-07-2018, 02:15 PM
                              12 responses
                              1,786 views
                              0 likes
                              Last Post Leafcutter  
                              Started by poplagelu, Today, 05:00 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post poplagelu  
                              Working...
                              X