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.

    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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      42 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      29 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      46 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      38 views
      0 likes
      Last Post CarlTrading  
      Working...
      X