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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      332 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X