• 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

Which ones are disposable elements? (what needs to use dispose() )?

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

    Which ones are disposable elements? (what needs to use dispose() )?

    In indicators, what type of elements needs to be disposed?

    i.e. fonts? Plot Colors? where is written full list and good example for NT7 (in addition, NT8 is welcomed too).

    so, indicators wont leave memory used in buffer and released everything correctly.

    I need all list and complete code by which i can instruct for my every indicator.

    #2
    Hello,

    Thank you for the post.

    NinajTrader will generally clean up resources for objects it creates so you do not need to. The disposal of resources we describe briefly in the help guide really only relates to custom objects you create that may require cleanup. One example would be a class you created that has Dispose implemented. Another example would be a custom event handler subscription and unsubscribe from that. Outside of custom objects that you may create that may require disposing of, you really wouldn't need to worry about doing this.

    This is also not something I could provide a complete list of as there is not a complete list of these items. Generally, if you are using some syntax that requires a Dispose, it would be listed where you found that syntax. Any NinjaTrader specific syntax that needs disposing of would be listed in the sample/indicator/type where it was used. A good example of this is found in NT8, the sharpdx resources that do need to be disposed of are disposed of and this is shown in their syntax.

    There are not any specific resources for NT7 that I could recommend calling dispose for. A better question may be, are you seeing a specific indicator have its memory rise uncontrollably or in an unreasonable way? If so, we could further explore that indicator to see what objects were used and what may be causing the problem.

    https://ninjatrader.com/support/help...arpdxresources
    https://ninjatrader.com/support/help...urceManagement


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

    Comment


      #3
      Thank you NT SUPPORT! you are excellent.

      Yes, i have specific problem with this indicator:

      https://ninjatrader.com/support/foru...293#post531293

      Comment


        #4
        Hello,

        Thank you for the reply.

        From the other post, I couldn't say what specifically would be causing the high memory use based on the description. I reviewed the files but it does appear there is quite a bit of logic in there to test. Also, there are two indicators here which add to the complexity.

        What I would likely suggest in this case would be to first find a situation where you can easily reproduce this problem. After locating that situation, it would probably be easiest to take away logic until the problem is no longer present. By take away logic, I just mean to slowly comment out portions of the script to locate the logic causing the high memory use.

        Once the problematic logic is located, this could then be extracted out of your existing scripts into a new test script and that could be used to reproduce/test the problem. If it is not apparent why that syntax is causing memory use, we could look at that together to find out why.

        From the files, I don't see anything you need to be disposing of to answer the question in the other thread.

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

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello,
          THANK YOU AGAIN ! ! ! I will check things.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by superkolleech, Today, 12:46 AM
          2 responses
          12 views
          0 likes
          Last Post superkolleech  
          Started by davidwade, Today, 02:51 AM
          0 responses
          3 views
          0 likes
          Last Post davidwade  
          Started by aviat72, 04-26-2020, 09:41 PM
          10 responses
          92 views
          0 likes
          Last Post kissandfly  
          Started by healthooa, Today, 01:28 AM
          0 responses
          8 views
          0 likes
          Last Post healthooa  
          Started by harjinderjit, Yesterday, 08:24 PM
          0 responses
          20 views
          0 likes
          Last Post harjinderjit  
          Working...
          X