Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can an addon detect when the ninjascript is getting recompiled?

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

    How can an addon detect when the ninjascript is getting recompiled?

    The way addons work is that they are restarted by a recompile.

    However, I need to be able to shut mine down properly if that happens.

    How can it detect when this is about to happen? Is there some kind of termination event?

    #2
    Hello NinjaCustomer,

    You should be able to use the addons OnStateChange system for this just like other NinjaScript types. You can find a quick reference of the states that can be used in the following page. State.Terminated could be used to clean up resources: https://ninjatrader.com/support/help...=onstatechange


    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      ok thanks, I was doing that already - i think it was some other bug i had that made it look like it was not cleaning up correctly but really an exception was occurring. But it is good to know that the terminated in onstatuschange fires during a recompile

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by patricia70, Today, 03:57 AM
      0 responses
      4 views
      0 likes
      Last Post patricia70  
      Started by pjsmith, Today, 03:25 AM
      0 responses
      6 views
      0 likes
      Last Post pjsmith
      by pjsmith
       
      Started by cincai, Today, 01:04 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by voltation, Today, 12:37 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Jason  
      Started by Negustrader, Today, 01:01 AM
      0 responses
      8 views
      0 likes
      Last Post Negustrader  
      Working...
      X