Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Dispose()" for removed strategies?

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

    "Dispose()" for removed strategies?

    Hi,

    Apparently Dispose() isn't being used in the same way on NT 6.5 as it was on NT 7...

    Basically, in my live strategies, I create a FileSystemWatcher... so I can monitor one of my configuration files (and update parameters dynamically). Before, I over-rode the strategy's dispose() function.

    Whenever I removed the strategy from the Strategies tab on 6.5, Dispose() is called, and I eliminate the FileSystemWatcher.

    Now, when I remove the strategy from the strategies tab in 7.0... apparently Dispose() isn't being called. How do I get similar behavior? Is there some function that's called when a strategy is disabled or removed?

    #2
    Hi heech,

    For version 7, you can clean up custom resources using OnTermination() handler.



    This sample has an example of using this to clean up stream writer resources.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    74 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    26 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    62 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X