Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to recover NinjaTrader custom assembly

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

    Unable to recover NinjaTrader custom assembly

    When I try to reload Ninjascript from a chart it just freeze.
    I have to close NinjaTrader with the Task Manager and when I reload NinjaTrader
    I get an error message that NinjaTrade cannot recover the custom assembly.
    I have attached the error message.

    Context :
    It does that only for an indicator that I converted from NT7.
    It does it only on the second time I apply the indicator. Goes through well the first time.


    I suspect it may come from the state.teminated.
    Do you see something that could cause the problem from my code :
    Code:
     if (ChartWindow != null)
    {
       //Dispatcher used to Assure Executed on UI Thread
         this.Dispatcher.Invoke((Action)(() =>
       {	
           //Button Null Check
           if(NewsButton != null)
       {
           //Remove Button from Indicator's Chart ToolBar
           ChartWindow.MainMenu.Remove(NewsButton);
           //Remove Button Event Handler
           NewsButton.Click -= NewsButton_Click;
           //Set Button to Null - Not Needed - Done out of Habit
           NewsButton = null;
       }
           //Remove Tab Changed Event Handler
           ChartWindow.MainTabControl.SelectionChanged -= TabChangedHandler;
           //Set ChartWindow to Null - Not Needed - Again Just Done out of Habit
           //ChartWindow = null;
    }));
    					
           //Dispatcher used to Assure Executed on UI Thread
           this.Dispatcher.Invoke((Action)(() =>
           {	
           //Button Null Check
           if(HelpButton != null)
           {
             //Remove Button from Indicator's Chart ToolBar
             ChartWindow.MainMenu.Remove(HelpButton);
             //Remove Button Event Handler
             HelpButton.Click -= HelpButton_Click;
             //Set Button to Null - Not Needed - Done out of Habit
             HelpButton = null;
    }
             //Remove Tab Changed Event Handler
             ChartWindow.MainTabControl.SelectionChanged -= TabChangedHandler;
             //Set ChartWindow to Null - Not Needed - Again Just Done out of Habit
             //ChartWindow = null;
    }));
    					
    					
               //Dispatcher used to Assure Executed on UI Thread
               this.Dispatcher.Invoke((Action)(() =>
               {	
                  if( SkipRemoveUpdater == false )
    	{
    	 try
    	 {
    	  GlobalVariables8.ResetDictionariesForInstrument( this.Name+Instrument.MasterInstrument.Name+Instrument.Expiry+Bars.BarsType.DisplayName+BarsPeriod.Value );
    	  GlobalVariables8.DisposeUpdater( this.Name+Instrument.MasterInstrument.Name+Instrument.Expiry+Bars.BarsType.DisplayName+BarsPeriod.Value );
                    }
    	   catch(Exception e)
    	   {
    	       Print(" An error occured : "+e.Message);
    	    }
    }
    					
    	     GlobalVariables8.UnSubscribe("globalLandscapeDict",this);
    }));
    									
    					
                        ChartWindow = null;
    }
    Attached Files
    Last edited by blar58; 03-19-2016, 09:45 AM.

    #2
    OK found out my problem.

    I have to be connected to real time data feed !

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    657 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    373 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    579 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X