Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnTermination() not called when NT message event occurs

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

    OnTermination() not called when NT message event occurs

    Hello,

    I am running into an issue where if there is some kind of NT message event (such as invalid instrument or invalid time frame, etc) then the OnTermination() function is NOT called, but Initialize() is called again. This is causing issues with my indicator since things are not correctly disposed within OnTermination, yet they are re-added during Initialize().

    Does my situation make sense?

    EDIT: Actually, I think it's OnStartUp() that is called again (rather than Initialize()) and OnTermination() is not.

    Thanks!
    Daniel
    Last edited by neoikon; 04-19-2012, 02:32 PM.

    #2
    On Termination should be called any time the strategy is terminated.

    Are you saying the strategy is getting terminated however On Termination is not being called?

    If so can you give me details on how to duplicate this so that I can test on my side.

    -Brett
    BrettNinjaTrader Product Management

    Comment


      #3
      My indicator adds a few object in OnStartUp() and removes them in OnTermination(). When I hit F5, all works as expected.

      However, I'm seeing my objects added twice when an NT error occurs (such as trying to go to an instrument that doesn't exist... that causes that loud error sound). I'm assuming what is happening is that OnTermination() is not called to remove my objects, but OnStartUp is called, thus my objects are added a second time.

      I'm trying to nail down the exact situation where my objects are not being removed properly. I'm also looking into just putting in additional checks to make sure, even in this situation, they won't be added twice.

      I'll let you know if I can find more information.

      Comment


        #4
        Sure,

        please let me know when you have some more information and we will analyze it. Thanks for reporting.

        -Brett
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Unsuitable, Today, 07:26 PM
        0 responses
        1 view
        0 likes
        Last Post Unsuitable  
        Started by jvanelli, Today, 06:36 PM
        1 response
        6 views
        0 likes
        Last Post jeronymite  
        Started by twitch251, Today, 05:14 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by robforee2, Today, 05:07 PM
        0 responses
        3 views
        0 likes
        Last Post robforee2  
        Started by blar58, Today, 03:16 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Working...
        X