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 eladlevi, Today, 11:02 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by synthhokie, Today, 10:24 AM
    5 responses
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by llanqui, 05-06-2024, 03:51 PM
    7 responses
    30 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by Lele2k24, Today, 01:32 PM
    0 responses
    3 views
    0 likes
    Last Post Lele2k24  
    Started by Richozzy38, Today, 01:06 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X