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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    115 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    161 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    83 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    127 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    87 views
    0 likes
    Last Post PaulMohn  
    Working...
    X