Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compiled strategy won't display correctly in "New Strategy" Window

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

    Compiled strategy won't display correctly in "New Strategy" Window

    I have a strategy which I have been modifying throughout the course of the day, recompiling and testing. This evening my computer crashed and now when I try to load the strategy in the "New Strategy" window it does display the correct parameters.

    I can still load, edit and compile the strategy successfully but I cannot load the strategy for testing in the Control Center Strategies tab.

    The error log shows: **NT** Failed to call method 'Initialize' for strategy 'rtUSM/789fed3af9cc45f8bbba0f66a690f76c': Value cannot be null.
    Parameter name: path

    However, there is no parameter named "path".

    I've tried doing a database repair, and I've tried re-creating the .cs file, having first removed entries related to it from the NinjaTrader.Custom.xml file, and removing the .cs and .xml files associated with the strategy. The same issue persists.

    I know that there is something that I'm missing...I just can't remember what!
    Your assistance would be greatly appreciated.

    Thanks,
    Robert.

    #2
    Hello Robert,

    Thank you for your post.

    Would you mind posting what you have being set in the Initialize() method of your script?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal,

      Thanks for your response. I don't believe that this is related to my code, as this strategy - without any modification - compiled and executed right up to the point where my computer crashed. The crash was unrelated to NinjaTrader.

      I believe that NT itself became corrupted as regards the only executing strategy at the time of the crash.

      I had this happen once before, but it was about a year ago and I've forgotten what I had to do to resolve the issue.

      Is there a sequence of actions that are used to recover NT after a system crash? I guess that should have been my original question.

      Thanks,
      Robert.

      Comment


        #4
        Looking at the trace logs for last night I found this entry immediately before the attempt to load my strategy. I've highlighted it with "===" on either side for ease of reference:

        2014-12-20 00:59:32:156 (Market Replay Connection) Cbi.ConnectionStatusEventArgs.Process: Disconnected Disconnected
        2014-12-20 00:59:32:187 (Market Replay Connection) Cbi.Connection.Close9
        ===
        2014-12-20 00:59:40:876 Code.Editor.OnLoad: Failed to reference 'NinjaTrader.Custom, Version=7.0.1000.25, Culture=neutral, PublicKeyToken=null': System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
        at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
        at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
        at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
        at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
        at System.Reflection.Assembly.LoadFrom(String assemblyFile)
        at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
        ===
        2014-12-20 01:00:33:950 ERROR: Failed to call method 'Initialize' for strategy 'rtUSM/90bf0f5c44a04281a14f2b2add6157c0': Value cannot be null.
        Parameter name: path
        2014-12-20 01:05:00:632 Gui.WorkspaceOptions.ApplicationExit

        This suggests to me that there was some kind of corruption of NT when the system crashed. Checking earlier logs there is no such entry. Is there anything that I need to do to secure my configuration before reloading NT, or is there some other way to recover from this corruption without reloading NT?

        Thanks,
        Robert.

        Comment


          #5
          Hello cmt_Robert,

          Thank you for your response.

          Looks like a corrupted installation. You can repair the install without losing your settings or files by following the instructions below:
          • Close all running applications.
          • Then from the Start menu select --> Control Panel --> Add and Remove Programs.
          • From Add and Remove Programs select NinjaTrader 7 and click Remove.
          • Then you will need to clear your internet browser cache and history. You will clear this from within your internet browser (with IE, Tools-->Options, delete cookies and files, clear history).
          • Reboot your machine.
          • Once these steps are completed, download NT7 from the link below: http://www.ninjatrader.com/download-free.php

          Comment


            #6
            Hi i'm getting the same issue

            Failed to call method 'Initialize' for strategy 'backtestBidAsk/50f77ea3982d49d18cb0b679b601d32d': Value cannot be null.
            Parameter name: source

            here is my initialize method
            protected override void Initialize()
            {
            Add("QOK5_QOS12Z5 05-15", PeriodType.Minute, 5, MarketDataType.Bid);
            Add("QOK5_QOS12Z5 05-15", PeriodType.Minute, 5, MarketDataType.Ask);
            ninja_instrument_manager.addInstrument("QOK5_QOS12 Z5", 1, 2);
            level1 = new Level( ninja_instrument_manager,
            Level.Level_Side.BUY,
            "QOK5_QOS12Z5", //symbol in ninjainstrumentmanager
            62.74, // entry price
            0, // entry adjustemnet price
            62.76, // exit price
            0, // exit adjustment price
            1, // quantity
            this
            );
            CalculateOnBarClose = true;

            }

            Comment


              #7
              Hello pipsalottle,

              Thank you for your post.

              Isolate the items in the Initialize() by commenting them out and any code that refers to the in your script. Then run the strategy. Comment out each item one by one until you find the cause.
              For information on debugging please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3418

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X