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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    86 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    92 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    70 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    87 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    64 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X