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 AttiM, 02-14-2024, 05:20 PM
    12 responses
    213 views
    0 likes
    Last Post DrakeiJosh  
    Started by cre8able, 02-11-2023, 05:43 PM
    3 responses
    237 views
    0 likes
    Last Post rhubear
    by rhubear
     
    Started by frslvr, 04-11-2024, 07:26 AM
    8 responses
    116 views
    1 like
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    10 responses
    47 views
    0 likes
    Last Post stafe
    by stafe
     
    Started by rocketman7, Today, 09:41 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X