Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RemoveDrawObject and indicator panel

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

    RemoveDrawObject and indicator panel

    Pardons if this has been posted before. I went through a number of posts related to RemoveDrawObject, but could not find something that matches my situation.

    I have this simplified indicator that draws a line on an indicator (within the indicator panel) and then, several bars later, calls RemoveDrawObject for that line. The line is not getting removed. See the attached code and screenshot.

    I'm trying to port an indicator from NT7, which is working fine, so what you see here is just a scaled down version to illustrate the issue I'm seeing in NT8.

    Version: 8.0.5.2 64-bit (Multi-Broker)
    OS: Windows 10 Home 64-bit, build 14393.953
    Attached Files

    #2
    Hello cbritton,

    Thank you for reporting the behavior.

    I will do further testing and once I am able to reproduce I will submit a report to our development.

    I appreciate your patience while I test.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Were you able to reproduce this issue?

      Thanks,
      Chris



      Originally posted by NinjaTrader_ChelseaB View Post
      Hello cbritton,

      Thank you for reporting the behavior.

      I will do further testing and once I am able to reproduce I will submit a report to our development.

      I appreciate your patience while I test.

      Comment


        #4
        Hi Chris,

        I am able to reproduce the behavior as long as the drawing object is not on the price panel.

        I have reported the behavior to our development. Once I have a tracking ID for the issue I will post this in this thread for future reference.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Also experiencing this bug

          I also have an indicator that draws on a non-price panel.
          My indicator has Calculate.Everytick = true and over the course of processing all the ticks for the current bar, I draw an object, then when conditions change, I will remove the object from the chart, (using the same tag).
          The remove is not working.

          Do you have a tracking ID yet for this issue?

          Gary Albers

          Comment


            #6
            Hi Gary,

            Our development has identified and corrected the issue before I was able to report it, however, this will be in the next release of NinjaTrader.

            Please wait for 8.0.6.0 to be released and test for the behavior once more.

            Post in this thread if the behavior can still be reproduced.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              RemoveDrawObject still does not work in 8.0.6.0

              Chelsea,

              I have installed 8.9.6.0 and have verified that the issue still exits:
              The problem occurs under these conditions:
              - indicator draws on a non-price panel (panel 2)
              - Tick Replay is ON, therefore my indicator processes every tick
              - On a given bar and the signal my switch from long to none or short to none.
              - The object drawn on the long or short signal does not go away when it is
              removed.
              - Here is the essential code:
              Code:
              if (longSignalHasFired && lastSignalBar != CurrentBar)
              {
              	Draw.VerticalLine(this, CurrentBar.ToString(), 0, Brushes.LimeGreen);
              	lastSignalBar = CurrentBar;
              	if (PrintDebugLines) Print(GELMethods.DateTimeBar(this) + ", signal Long:  " + CurrentBar);
              }
              else if (shortSignalHasFired && lastSignalBar != CurrentBar)
              {
              	Draw.VerticalLine(this, CurrentBar.ToString(), 0, Brushes.Red);
              	lastSignalBar = CurrentBar;
              	if (PrintDebugLines) Print(GELMethods.DateTimeBar(this) + ", signal Short: " + CurrentBar);
              }
              else
              {
              	RemoveDrawObject(CurrentBar.ToString());
              	lastSignalBar = 0;
              	if (PrintDebugLines) Print(GELMethods.DateTimeBar(this) + ", NO signal: " + CurrentBar);
              }
              Please advise if you see something I am doing wrong.

              Gary

              Comment


                #8
                Hi ChelseaB,

                I'm still seeing the issue with 8.0.6.0 and with the test indicator I provided in my first post. Please retry it with 8.0.6.0 to confirm.

                Thanks,
                Chris



                Originally posted by NinjaTrader_ChelseaB View Post
                Hi Gary,

                Our development has identified and corrected the issue before I was able to report it, however, this will be in the next release of NinjaTrader.

                Please wait for 8.0.6.0 to be released and test for the behavior once more.

                Post in this thread if the behavior can still be reproduced.

                Comment


                  #9
                  Originally posted by GaryAlbers View Post
                  Code:
                  if (longSignalHasFired && lastSignalBar != CurrentBar)
                  {
                      Draw.VerticalLine(this, CurrentBar.ToString(), 0, Brushes.LimeGreen);
                      lastSignalBar = CurrentBar;
                  }
                  else if (shortSignalHasFired && lastSignalBar != CurrentBar)
                  {
                      Draw.VerticalLine(this, CurrentBar.ToString(), 0, Brushes.Red);
                      lastSignalBar = CurrentBar;
                  }
                  else
                  {
                      RemoveDrawObject(CurrentBar.ToString());
                      lastSignalBar = 0;
                  }
                  Please advise if you see something I am doing wrong.
                  Gary
                  I think the problem is that your CurrentBar tag will cause RemoveDrawObject to look for the draw object to be on the current bar, but it would actually be on some previous bar instead. Try setting lastSignalBar before Draw.VerticalLine and use that variable as the tag instead of CurrentBar.

                  Comment


                    #10
                    tradesmart,

                    Thanks for the comment, but I am certain that at the time the code tries to remove the drawn object it is referring to the correct bar number, I have verified this in debugging.
                    My scenario is when TickReplay is on which means there are multiple times the logic executes on the same bar number.

                    NOTE: When this indicator is run on the primary price panel the RemoveDrawObject call works correctly. Just by moving the indicator to a new, separate panel, the remove stops working.

                    Gary

                    Comment


                      #11
                      Thank you all for your additional reports and information.

                      We look to have this resolved in the next release of NinjaTrader 8.

                      Please let me know if you have any questions.

                      Comment


                        #12
                        Specifically, what release number will contain the fix for this issue?

                        Gary

                        Comment


                          #13
                          Hello Gary,

                          While I cannot guarantee the release numbers the next logical release version number would be 8.0.7.0.

                          This issue is being tracked with ID #NTEIGHT-11631.

                          Please wait until the next iteration is released before checking for this ID in the release notes.


                          After the release of the next iteration, if you are not able to find this in the release notes, you can check back with us to see if the correction made it into that version.
                          Chelsea B.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by adeelshahzad, Today, 03:54 AM
                          5 responses
                          32 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by stafe, 04-15-2024, 08:34 PM
                          7 responses
                          32 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by merzo, 06-25-2023, 02:19 AM
                          10 responses
                          823 views
                          1 like
                          Last Post NinjaTrader_ChristopherJ  
                          Started by frankthearm, Today, 09:08 AM
                          5 responses
                          21 views
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by jeronymite, 04-12-2024, 04:26 PM
                          3 responses
                          43 views
                          0 likes
                          Last Post jeronymite  
                          Working...
                          X