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

accountselector cleanup

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

    accountselector cleanup

    Hello, i am using an AccountSelector within an AddonBase and looking at the cleanup in handling the

    accountSelector.SelectionChanged & account.Selected.AccountItemUpdate

    components.

    For the AccountSelector in the help it mentions the cleanup() which disposes of the AccountSelector and to call NTTabPage.base.Cleanup()

    how does one do this within a class derived from AddonBase as i am not using and do not need a tab in my addon for this instance?

    Also within my OnWindowCreated( Window window) within Addon base - this is where i install my addon to an existing Window .. in this case checking for window as Chart.

    Now all this is working fine and i see OnWindowCreated() is called whenever a new NTWindow is created.

    Is there a method within the Addon framework which will be called whenever a new tab is created within an NTwindow ? can i get a notfication for this? ie onWindowTab() .. distinct from the addon tabs?

    thanks

    #2
    Hello soulfx,

    Below I am providing a link to an example script that demonstrates detecting when a tab is opened (added to the tab collection), closed (removed from the tab collection), selected (loaded), or unselected (unloaded).



    I would recommend removing handlers from events when the TabCollection change event triggers as the tab is removed.

    If the addon does not have tabs, I would recommend removing the handlers in a handler added to the unloaded event of the NTWindow.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      at NTWindow derived classes is also a eventhandler called "Closed" available. I have put all my cleanups to this handler.
      Probably the Unloaded and the Closed handlers are fired at the same time when window is closing.

      Comment


        #4
        Thanks Chelsea, i did see this when searching forum. Given it is the chart tab collection changes i need not the addon - this gave me the insight to what i need and is working based on changes to the chart tab control.

        Thanks GoSPvC - it is the AddonBase that i am using and so i have been doing the cleanup of resources and handlers in the onWindowDestroyed() which seems to be working fine ; i just wondered if there was a better/ alternate place to cleanup given this is derived from AddonBase and thus a chart window instance and not an Addon NTWindow.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by frankthearm, Today, 09:08 AM
        7 responses
        27 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by NRITV, Today, 01:15 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by maybeimnotrader, Yesterday, 05:46 PM
        5 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by quantismo, Yesterday, 05:13 PM
        2 responses
        16 views
        0 likes
        Last Post quantismo  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X