• 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

RemoveDrawObject() causes the NinjaTrader Platform to Crash

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

    RemoveDrawObject() causes the NinjaTrader Platform to Crash

    To NT Development Team,

    I have a very strong suspicion that the RemoveDrawObject() method is faulty. If a user includes the RemoveDrawObject() method in their code without first checking whether the object is null then this will cause NinjaTrader to crash intermittently. In addition, I suspect that you must also go a step further and check whether the object is the intended type (ex., "is DrawingTools.Line") or the platform will still crash. This is a problem that I noted goes back to NinjaTrader version 7 and I have shied away from calling the RemoveDrawObject() method as a result. I guess I figured that NinjaTrader would've discovered and fixed the problem by now. However, I'm now bringing it to the attention of the development team and hopefully someone could look into it.

    I think the below code from your user documentation works but I'm not 100% sure.

    Code:
    if (DrawObjects["someTag"] != null && DrawObjects["someTag"] is DrawingTools.Line)
    {
        RemoveDrawObject("someTag")
    }
    On a side note, I have not had any problems with the general version method: RemoveDrawObjects().

    #2
    Hello maltese ,

    Thank you for the post.

    Do you have a test script which reproduces a crash that you can attach? The syntax you provided is generally not needed to remove an object, mainly only the string name is needed. If you have a sample which shows the whole context of the problem that would be helpful and I could forward that to development for review.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello maltese ,

      Thank you for the post.

      Do you have a test script which reproduces a crash that you can attach? The syntax you provided is generally not needed to remove an object, mainly only the string name is needed. If you have a sample which shows the whole context of the problem that would be helpful and I could forward that to development for review.

      I look forward to being of further assistance.

      Hi,

      Unfortunately the code is proprietary where I'm using the statements. However, I provided an example in my original post regarding how I remove specific draw objects now and I have included how I use to remove draw objects below. I believe the problem should be reproducible on your end, albeit intermittently, with test code.

      OLD WAY:

      Code:
        
       RemoveDrawObject("someTag");
      OR:
      Code:
        
       if (DrawObjects["someTag"] != null) {     RemoveDrawObject("someTag"); }

      Comment


        #4
        Hello maltese,

        I have tried using RemoveDrawObject() however that works for my test, using RemoveDrawObject is the standard way the help guide suggests to remove objects. To file a bug report we would need something more solid in this case, for this type of issue a sample of the syntax used is what we would need to explore the problem.

        If the code is proprietary this would be a good situation to further debug and extract a sample of the syntax before you continue. Extracting the code may also help to find the problem in your script in case the sample works, this could help to isolate if the problem is specifically related to removing objects.

        When creating a sample we do not suggest providing a complete or proprietary script as we are unable to debug your custom code, instead we would suggest only including the syntax related to seeing the problem to highlight the issue. This allows us to run the code and see the problem, after verifying a problem exists we can create a bug report. You can additionally email our platform support at ninjatrader.com if you don't want to use the forums.

        If you can also provide the specific steps you are using with the script when you see the problem that would help expedite reviewing the case.




        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello maltese,

          I have tried using RemoveDrawObject() however that works for my test, using RemoveDrawObject is the standard way the help guide suggests to remove objects. To file a bug report we would need something more solid in this case, for this type of issue a sample of the syntax used is what we would need to explore the problem.

          If the code is proprietary this would be a good situation to further debug and extract a sample of the syntax before you continue. Extracting the code may also help to find the problem in your script in case the sample works, this could help to isolate if the problem is specifically related to removing objects.

          When creating a sample we do not suggest providing a complete or proprietary script as we are unable to debug your custom code, instead we would suggest only including the syntax related to seeing the problem to highlight the issue. This allows us to run the code and see the problem, after verifying a problem exists we can create a bug report. You can additionally email our platform support at ninjatrader.com if you don't want to use the forums.

          If you can also provide the specific steps you are using with the script when you see the problem that would help expedite reviewing the case.




          I look forward to being of further assistance.
          I hear you but I don't want to get pulled into helping debug this issue. I really just wanted to bring it to your technical team's attention so that someone on your end can take a look at it. Unfortunately, I can't spend any more time on this but thanks for your help.

          Regards

          Comment


            #6
            Hello maltese,

            Thank you for the clarification.

            If you find the time to further debug your script I would be happy to continue with the issue further. At this time I am unable to reproduce the problem with the given details. If you find other details which can help to recreate the problem using only the syntax provided I would be happy to give that another try.



            Please let me know if I may be of additional assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rontronimous, Today, 05:55 PM
            0 responses
            8 views
            0 likes
            Last Post rontronimous  
            Started by bcgeek, Today, 03:43 PM
            2 responses
            6 views
            0 likes
            Last Post bcgeek
            by bcgeek
             
            Started by Mberg, Today, 04:05 PM
            0 responses
            9 views
            0 likes
            Last Post Mberg
            by Mberg
             
            Started by dkbyond, Today, 03:52 PM
            0 responses
            5 views
            0 likes
            Last Post dkbyond
            by dkbyond
             
            Started by Newtrader101, Today, 03:09 PM
            2 responses
            7 views
            0 likes
            Last Post Newtrader101  
            Working...
            X