Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

    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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by terofs, Yesterday, 04:18 PM
        1 response
        21 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by RookieTrader, Today, 09:37 AM
        2 responses
        13 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X