Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Intermittent startup problems

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

    Intermittent startup problems

    Hi, some times NinjaTrader just doesn't start up properly and other times it does. That wouldn't be a really bad problem if it would just display an error message that it didn't start up properly so I'd know to restart the program. Instead, everything looks just fine and then no trades are placed.

    There are two problems here: one is that the program isn't starting up properly, and the other is that there's no indication that the program started up improperly. The second problem is more important.

    Attached are two trace files, both very small. The first one is from Friday, when the system gave me no indication that there was any problem and didn't place any trades. The other is from today, when it started up with a problem and I noticed it because I looked in the trace file and restarted the program. The second startup worked just fine. Here's a snippet from Friday's trace file (line 115):


    2013-11-01 07:27:26:061 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\NinjaTrader.Core.dll': System.ApplicationException: Could not load exported type data for assembly 'NinjaTrader.Core, Version=7.0.1000.16, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Method 'OnMaterialized' in type 'NinjaTrader.Cbi.Order' from assembly 'NinjaTrader.Core, Version=7.0.1000.16, Culture=neutral, PublicKeyToken=null' does not have an implementation.
    at System.Reflection.Assembly._GetExportedTypes()
    at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
    --- End of inner exception stack trace ---
    at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
    at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
    at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
    at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
    at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Dot NetProjectResolver.AddExternalReference(String assemblyName)
    at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
    2013-11-01 07:27:26:123 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\WilsonORMapper.dll': System.ApplicationException: Could not load exported type data for assembly 'WilsonORMapper, Version=4.2.2.0, Culture=neutral, PublicKeyToken=null' and type 'Wilson.ORMapper.ObjectSpace'. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
    File name: 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll'
    at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
    at System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
    at System.Reflection.RuntimeMethodInfo.get_Signature( )
    at System.Reflection.RuntimeMethodInfo.FetchNonReturn Parameters()
    at System.Reflection.RuntimeMethodInfo.GetParameters( )
    at ai..ctor(k A_0, Type A_1)
    at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
    Attached Files

    #2
    This is very similar to a problem encountered less than two months ago. Then, NT Support said the problem was related to my .NET installation, even though there was no indication that the .NET installation was faulty. I only have trace files dating back to 10/15, but this problem occurred on 10/19, 10/28, 10/29, 10/30, 10/31, 11/1, and 11/4. The problem did not occur on the other dates, and I got a clean startup after the faulty startup on 11/4. So there's no way this problem is caused by a faulty .NET installation, which was "repaired" in September.

    Comment


      #3
      Thanks for the report egan857, the System.Data dll was that added in by you? Looks like this would be from a newer target framework than the supported 3.5 one here. What should be then used as reference is the file from the 2.0 framework instead of the 4.0 / 4.5 one. Then please see if this issue would still occur for the setup.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Hi Bertrand,


        In the other support thread for this problem (link in post #2 of this thread), JC said that I should be on .NET release 4. Even when I told him I was on 4, he requested that I "repair" that release to get the latest release 4. Are you saying now that release 4 isn't supported? I didn't understand the third sentence; are you saying I should be on release 2?

        Besides, none of this addresses the real issue: why is Ninja Trader failing to start up properly and not throwing any visible error messages?

        Comment


          #5
          Sorry for the confusion here, let me try to clarify -

          NT7 is build on and support NET 3.5 - assemblies from newer NET's like 4.0 and 4.5 could unfortunately not be loaded since the target framework would not resolve in this setup.

          Win7 PC's would naturally have 4.0 installed and support a windows feature to activate in 3.5 to support applications that would need this environment or parts of 2.0 (since 3.5 would include support for 2.0).

          Your System Data DLL likely is taken from the 4.0 framework and thus could not be referenced in NT7 unfortunately, our next major platform upgrade would support latest .NET 4.5 (however would not have an ETA for this to become available).

          For your setup now I would suggest referencing the System Data dll from the C:\Windows\Microsoft.NET\Framework\v2.0.50727 folder for compatibility.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Hi Bertrand,

            That still doesn't explain why Ninja Trader thought System.DLL was unacceptable the first time I started it this morning, but it had no problems with System.DLL the second time I started it this morning. Why is this an intermittant problem? This is why I don't think the problem is with System.DLL at all, because changing it doesn't affect the intermittancy of the problem.

            I think the problem is related to the problems I had installing the last two releases (.15 and .16??). In both cases, I clicked on the install link and the installer installed the 32-bit versions instead of the 64-bit versions (I did not have NT running at the time). I think there's a problem in the Registry that's telling NT that I'm running a 32-bit application, but even that doesn't explain the intermittancy.

            I think NT is sometimes looking for a 32-bit version of system.dll and other times looking for a 64-bit version of system.dll.

            Comment


              #7
              egan857, from what I've see so far I could unfortunately not explain the intermittancy of the issue at this point, what I do recommend still though as first step working on the setup is ensuring the correct version reference is listed and that would be the one from the 2.0 framework here. Then I would recheck if the issue would remanifest. There would be no 32 or 64 bit dll picked in this case that should contribute.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Hi Bertrand,

                OK, so let me make sure I have this right. I need to edit my strategy, right-click on it, select References, delete the existing System.dll and replace it with the one you mentioned, right?

                I did that, but I don't think there's any way that could possibly solve the problem. I get the problem immediately after starting up the application, before I've ever attempted to run any strategy. How would my references to my strategy affect whether or not Ninja Trader will start up correctly?

                The problem did not recur, but it never recurs after I have shut down Ninja Trader that day. It only fails on the first occurrence of starting up Ninja Trader.

                Plus, we still haven't addressed the important issue: why isn't Ninja Trader displaying an error message when it can't recognize System.dll?

                Comment


                  #9
                  Oh wait. Correction, I do get a different error now. This error displayed immediately after startup and before attempting to start any strategies:


                  2013-11-04 12:26:50:261 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\NinjaTrader.Core.dll': System.ApplicationException: Could not load exported type data for assembly 'NinjaTrader.Core, Version=7.0.1000.16, Culture=neutral, PublicKeyToken=null'. ---> System.TypeLoadException: Method 'OnMaterialized' in type 'NinjaTrader.Cbi.Order' from assembly 'NinjaTrader.Core, Version=7.0.1000.16, Culture=neutral, PublicKeyToken=null' does not have an implementation.
                  at System.Reflection.Assembly._GetExportedTypes()
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
                  --- End of inner exception stack trace ---
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Dot NetProjectResolver.AddExternalReference(String assemblyName)
                  at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
                  2013-11-04 12:26:50:324 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\WilsonORMapper.dll': System.ApplicationException: Could not load exported type data for assembly 'WilsonORMapper, Version=4.2.2.0, Culture=neutral, PublicKeyToken=null' and type 'Wilson.ORMapper.ObjectSpace'. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
                  File name: 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll'
                  at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
                  at System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
                  at System.Reflection.RuntimeMethodInfo.get_Signature( )
                  at System.Reflection.RuntimeMethodInfo.FetchNonReturn Parameters()
                  at System.Reflection.RuntimeMethodInfo.GetParameters( )
                  at ai..ctor(k A_0, Type A_1)
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)

                  WRN: Assembly binding logging is turned OFF.
                  To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
                  Note: There is some performance penalty associated with assembly bind failure logging.
                  To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

                  --- End of inner exception stack trace ---
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Dot NetProjectResolver.AddExternalReference(String assemblyName)
                  at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
                  2013-11-04 12:26:50:339 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll': System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
                  File name: 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll'
                  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.ReflectionOnlyLoadFrom( String assemblyFile)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(String A_0)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.b(String A_0)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.b(String A_0)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Dot NetProjectResolver.AddExternalReference(String assemblyName)
                  at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)

                  WRN: Assembly binding logging is turned OFF.
                  To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
                  Note: There is some performance penalty associated with assembly bind failure logging.
                  To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

                  2013-11-04 12:26:50:371 Code.Editor.OnLoad: Failed to reference 'C:\Program Files (x86)\NinjaTrader 7\bin\MySql.Data.dll': System.ApplicationException: Could not load exported type data for assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'. ---> System.BadImageFormatException: Could not load file or assembly 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
                  File name: 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll'
                  at System.Reflection.Assembly._GetExportedTypes()
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)

                  WRN: Assembly binding logging is turned OFF.
                  To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
                  Note: There is some performance penalty associated with assembly bind failure logging.
                  To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

                  --- End of inner exception stack trace ---
                  at k..ctor(Assembly A_0, String A_1, String A_2, String A_3, Boolean A_4)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.a.a(c A_0, ResolveEventHandler A_1)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Ass emblyCodeRepository.Add(String assemblyName, DotNetProjectResolver projectResolver)
                  at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.Dot NetProjectResolver.AddExternalReference(String assemblyName)
                  at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
                  2013-11-04 12:26:51:993 Code.Editor.OnLoad: Failed to reference 'NinjaTrader.Custom, Version=7.0.1000.16, 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.InternalLoad(AssemblyNa me assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
                  at System.Reflection.Assembly.LoadFrom(String assemblyFile)
                  at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)

                  Comment


                    #10
                    There is something really strange with your installation. There is this line:
                    File name: 'file:///C:\Program Files (x86)\NinjaTrader 7\bin\System.Data.dll'
                    Was that a reference that you created? I ask because .NET files are not supposed to be located in that directory.

                    The picture shows the references that are in a pristine NT installation. There is no reference linked to that file name. If you need that reference, you should probably be linking to the one that is installed in either the .NET directory or the global assembly cache.
                    Attached Files

                    Comment


                      #11
                      Hi Konganam,

                      Good catch. I added System.Data.dll to the Ninja Trader folder in April 2012 when I was trying to figure out how to connect to Oracle. I just removed it from the folder (it was never in the references, so it didn't need to be removed from there). Couldn't see everything in your list. Now my references look like this. Anything look odd, besides system.dll being an extremely old version and at the bottom of the list?

                      System.Core.dll
                      System.Drawing.dll
                      System.Windows.Forms.dll
                      System.XML.dll
                      C:\Program Files (x86)\NinjaTrader 7\bin\NinjaTrader.Core.dll
                      C:\Program Files (x86)\NinjaTrader 7\bin\WilsonORMapper.dll
                      C:\Program Files (x86)\NinjaTrader 7\bin\MySQL.Data.dll
                      C:\Users\egan\Documents\NinjaTrader 7\Bin\Custom\NinjaTrader.Vendor.dll
                      C:\Windows\Microsoft NET\Framework\v2.0.50727\System.dll
                      Last edited by egan857; 11-05-2013, 08:05 AM.

                      Comment


                        #12
                        Hi Bertrand,

                        Got a new error message today:

                        2013-11-05 07:45:34:223 Code.Editor.OnLoad: Failed to reference 'NinjaTrader.Custom, Version=7.0.1000.16, 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.InternalLoad(AssemblyNa me assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
                        at System.Reflection.Assembly.LoadFrom(String assemblyFile)
                        at NinjaTrader.Code.Editor.OnLoad(Object sender, EventArgs e)
                        2013-11-05 07:48:19:534 (Kinetick) Data.Bars.GetBarsNow: instrument='BAC' from='2013-10-16' to='2013-11-04' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:48:20:065 (Kinetick) Data.Bars.GetBarsNow: instrument='BAC' from='2013-11-05' to='2013-11-05' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:48:55:912 (Kinetick) Data.Bars.GetBarsNow: instrument='DIA' from='2013-10-16' to='2013-11-04' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:48:56:349 (Kinetick) Data.Bars.GetBarsNow: instrument='DIA' from='2013-11-05' to='2013-11-05' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:19:618 (Kinetick) Data.Bars.GetBarsNow: instrument='ABT' from='2013-10-24' to='2013-11-04' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:19:899 (Kinetick) Data.Bars.GetBarsNow: instrument='ABT' from='2013-11-05' to='2013-11-05' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:20:086 (Kinetick) Data.Bars.GetBarsNow: instrument='ABT' from='2013-10-24' to='2013-11-04' period=Daily splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:20:258 (Kinetick) Data.Bars.GetBarsNow: instrument='ABT' from='2013-11-05' to='2013-11-05' period=Daily splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:20:508 (Kinetick) Data.Bars.GetBarsNow: instrument='ABT' from='2013-11-04' to='2013-11-04' period=1 Min splitAdjusted=False dividendAdjusted=False bars=0 session='US Equities ETH'
                        2013-11-05 07:50:20:882 Db.Globals.StrategyUpdateJob3: WARNING: ABT Default

                        Gotta love it. WARNING, and then no information about why it's a warning.

                        If Ninja Trader sees a problem with something, like in this case with one of the references and a symbol, why doesn't it display that there is a problem? It's before market hours. I see no problem starting up, so I just drive to the office and then come back at night and find out that NT didn't trade, and I lose a day of simulated trading. Even if I stayed at home, I wouldn't know there was a problem; I'd just assume that no stocks qualified for the strategies.

                        Comment


                          #13
                          egan857, this error message seen in your files can be safely ignored.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #14
                            Hi Bertrand,

                            The problem is that at least some of these errors are not just warnings. I had three programs running today, and the simplest one, the heartbeat program, died 6 minutes after the open. I'm pretty sure the other two died before placing a trade. It's getting to be a common occurrence that I come home at the end of the day and find out that nothing has traded, no heartbeats were logged, and there are error messages in the trace file that were not deemed serious enough for an error message in Ninja Trader.

                            Comment


                              #15
                              egan857, so you're saying your connection was not working 6 mins after open anymore, but you did not see a ConnectionLoss event for your NT setup?

                              Apart from that it's important to mention that NT was not designed for black box operation for extended periods without a trader overseeing its operations continuously.
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Kaledus, Today, 01:29 PM
                              2 responses
                              7 views
                              0 likes
                              Last Post Kaledus
                              by Kaledus
                               
                              Started by frankthearm, Yesterday, 09:08 AM
                              13 responses
                              45 views
                              0 likes
                              Last Post frankthearm  
                              Started by PaulMohn, Today, 12:36 PM
                              2 responses
                              16 views
                              0 likes
                              Last Post PaulMohn  
                              Started by Conceptzx, 10-11-2022, 06:38 AM
                              2 responses
                              55 views
                              0 likes
                              Last Post PhillT
                              by PhillT
                               
                              Started by yertle, Yesterday, 08:38 AM
                              8 responses
                              37 views
                              0 likes
                              Last Post ryjoga
                              by ryjoga
                               
                              Working...
                              X