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 MonteK, Yesterday, 09:31 PM
    0 responses
    25 views
    0 likes
    Last Post MonteK
    by MonteK
     
    Started by nkhoi, Yesterday, 09:27 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by SuperDude123, Yesterday, 03:52 PM
    4 responses
    26 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by ErikY, Yesterday, 01:16 PM
    1 response
    25 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by BullyWig Trader, Yesterday, 12:42 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X