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 CarlTrading, Yesterday, 09:41 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    31 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    30 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-25-2026, 09:53 PM
    0 responses
    34 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 03-25-2026, 09:51 PM
    0 responses
    19 views
    0 likes
    Last Post CaptainJack  
    Working...
    X