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 hdge4u, Yesterday, 09:09 PM
      0 responses
      15 views
      0 likes
      Last Post hdge4u
      by hdge4u
       
      Started by hdge4u, Yesterday, 09:02 PM
      0 responses
      8 views
      0 likes
      Last Post hdge4u
      by hdge4u
       
      Started by stormcloudseven, Yesterday, 08:41 PM
      1 response
      9 views
      0 likes
      Last Post DavidTrades  
      Started by GussJ, Yesterday, 01:24 PM
      0 responses
      23 views
      0 likes
      Last Post GussJ
      by GussJ
       
      Started by frslvr, Yesterday, 12:40 PM
      0 responses
      16 views
      0 likes
      Last Post frslvr
      by frslvr
       
      Working...
      X