• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Unable to open NinjaTrader7 following its crash

  • Filter
  • Time
  • Show
Clear All
new posts

    Unable to open NinjaTrader7 following its crash

    After uncommenting 3 lines in a custom strategy I am writing, I attempted to compile that strategy. NinjaTrader 7 version 40 warned that if I were to continue, it would crash. When I attempted to close my strategy, the X in the upper right-hand corner of all NT7 windows turned red. After waiting for nearly one half hour for NT 7 to close, I finally needed to exit if via Windows 10 Task Manager.

    I then shutdown my PC and booted it again. When I attempted to open NT7, the splash screen displayed and then disappeared. After about 90 seconds, the Control Center appeared. Its X in the upper right-hand corner was red.

    Again, I waited for NT7 to continue. After about 15 minutes of waiting, I exited NT7 by using Windows Task Manager a second time. I then opened Windows Control Panel and uninstalled NT7.

    Following that, I installed NT7 again with my most recent installation file (Version 40, downloaded on April 9. 2019 from the NT site). Once installed, I attempted to open it. As before, Control Center appeared with a red X in its upper right-hand corner. That was 30 minutes ago.

    What do you recommend I do next to fix this problem?

    Hi Longhornmark, thanks for your note.

    It sounds like the workspace is trying to load a script that is causing the crash. Please navigate to Documents\NinjaTrader 7\workspaces and delete the file named "_Workspaces.xml", after this, restart NT and it should start up in a blank workspace. If you would like for me to clear off all the indicators from the workspace that is not loading, please post the workspace file from that same directory here and I will purge it of indicators so you don't have to set up charts again.

    I look forward to hearing of your results.
    Chris L.NinjaTrader Customer Service


      Hi Chris - When I attempt to upload the _Workspaces.xml file here, I receive an error message that says I am not allowed to upload files with .xml extensions.

      So, I've uploaded that _Workspaces.xml file to my Microsoft OneDrive storage site. The link for it at OneDrive should appear herein.

      The troublesome Workspace is the one labeled "CL 2019 07". Other workspaces in the Workspaces folder seem to open okay after deleting the _Workspaces.xml file locally and then restarting NT.

      I suspect the .cs files causing trouble are the ones labeled "Hammer Buy" and "Inverted Hammer Sell". They were the two I was editing at the time of the crash. Inverted Hammer Sell was the one I was trying to compile.

      If those two .cs files are not the cause of the crash, then please delete the indicators as you said you could do.



        I guess I spoke too soon. Yes, after deleting the _Workspaces.xml file locally, I then was able to open NT. Once open, I then was able to open my primary workspace, the one labeled "... June Group".

        However, I just discovered I cannot connect to my data source. NT hangs when I try doing that.

        I seem unable to do anything in NT for the time being.


          Hi Longhornmark, thanks for your reply.

          It looks like you posted the Workspace.xml file, you will need to upload the xml file with the same name as the workspace that will not load. You can right click the xml file>Send To>Compressed (zip) file and upload that directly to the forum.

          Now that I think of it, it would likely fix the issue if you removed these scripts from your NinjaTrader 7 folder. The .cs files can be found under Documents\NinjaTrader 7\bin\Custom\Indicator, try removing these then open up the problem workspace. If you want me to purge the workspace of all custom indicators please post the workspace file.

          I look forward to hearing of your results.
          Chris L.NinjaTrader Customer Service


            I just tried removing TraderWorkstation as an Account Connection (my usual data source) and then adding it back as a new Account Connection. Unfortunately, NT still hangs, even when I try to connect to that new TWS Account Connection.
            Last edited by Longhornmark; 05-22-2019, 03:12 PM.


              I copied and pasted HammerBuy.cs and InvertedHammerSell.cs to my Windows Desktop. I then deleted them from NT and Documents\NinjaTrader 7\bin\Custom\Strategy by going to Tools -> Edit NinjaScript -> Strategy -> and then selecting each one, followed by clicking the Delete button.

              After doing that, I was able to connect to my TWS Account Connection and open both the CL 2019 07 and Globex...June Group workspaces. So, that is the good news.

              However, with HammerBuy.cs and InvertedHammerSell.cs now deleted from my Documents\...\Custom\Strategy folder, how can I resume editing them for use? Is that possible anymore? Remember, I haven't lost them permanently; they're on my Windows Desktop awaiting import back into NT.


                Hi Longhornmark,

                Typically compile errors would not cause a crash. The first thing we should check is your latest trace files located under Documents\NinjaTrader 7\trace. Select one of them from today and go to the bottom, please share what you see (stack trace, unhandled exceptions, etc)

                Try restarting NinjaTrader>Save the workspace, After it opens up again, move the scripts into the indicator folder again and attempt to compile, check for any compile errors. If the problem arises again, take them out and you can send the files to me at platformsupport at ninjatrader.com, reference "ATTN ChrisL" in the body of the email.
                Chris L.NinjaTrader Customer Service


                  Hi Chris -

                  I'm scanning through the 5/22 log in the trace20190522.txt file. The first instance of trouble I see occurred at 14:15 EDT. The log states NT found a recursive property in HammerBuy.cs. That was one of two strategies I was editing at the time. InvertedHammerSell was the other.

                  I see the session broke at 14:22 EDT. That probably was the time of the first NT crash.

                  I attempted restart at 14:29. The log only goes as far as stating it was restoring workspace CL 2019 07. And then another session break appears, which probably was the second NT crash.

                  I see a similar log entry at 14:56, which would've been the third NT crash. And then I see another similar log entry at 15:03, followed by another system break.

                  The log warns NT was unable to restore strategies InvertedHammerSell and HammerBuy beginning at 17:08. By then, I had copied and pasted them from my Documents\...\Custom\Strategy folder to my Desktop and then Deleted them via NinjaScript Edit.

                  Finally, at 17:20, the log notes that NT was unable to restore 3 old strategies I deleted on Tuesday via NinjaScript Edit and Delete. I don't know why it would attempt to restore them, as I deleted them by navigating to Tools -> Edit NinjaScript -> Strategy and then selecting them for deletion with the Delete button. I don't need those 3 old strategies anymore.

                  I restarted NT, which took me directly to my CL 2019 07 workspace as usual. I then copied and pasted HammerBuy.cs and InvertedHammerSell.cs from the Desktop back into the Documents\...\Custom\Strategy folder.

                  After that, I navigated to Tools -> Edit NinjaScript -> Strategy and selected HammerBuy, one of the two .cs files I was attempting to edit immediately prior to the first NT crash. It opened as usual. When I attempted to compile it, however, I got the same warning message I first saw immediately before the first crash. It said, "Your strategy likely holds one or more recursive properties which could cause NinjaTrader to crash: LookbackPeriod. Do you want to edit these properties?"

                  I selected Yes, and then closed the strategy without doing anything to it.

                  I then reopened the strategy and studied LookbackPeriod. I already had defined it in Variables as an int. Its properties at the bottom of the strategy also state it is an int. LookbackPeriod appears only once in my coding. That's on Line 72.

                  I've attached HammerBuy.cs to this message, so your expert eyes might discern what the recursive property is regarding LookbackPeriod. I don't see anything wrong, but I am no expert.
                  Attached Files


                    Hi Chris - This morning, I uninstalled and reinstalled NT by using the built-in uninstaller included with the installation program. I then reinstalled NT.

                    After that, I was able to open NT. I also was able to open my Workspaces.

                    I had removed HammerBuy.cs and InvertedHammerSell.cs from Documents:\...\Custom\Strategy last night and placed them back on my Desktop.

                    This morning, I copied each one from the Desktop back to that Strategy folder. I was able to open for editing HammerBuy.cs by selecting Edit NinjaScript -> Strategy, which I could not do last night. I imagine the built-in uninstaller followed by the reinstallation made this possible.

                    I then scrolled down to Properties to look at LookbackPeriod, which was the variable about which I had received the crash warning on Wednesday afternoon. I immediately saw the cause of trouble, which I had failed to detect yesterday:

                    My code had tried to return the public LookbackPeriod and set the public LookbackPeriod, rather than the private variants in each case. Once I had changed that capital L to lowercase, HammerBuy.cs compiled with no warning of impending crash.

                    I seem to be back to where I should be. If any further issues should develop regarding this matter, I'll post here to let you know.



                    Latest Posts


                    Topics Statistics Last Post
                    Started by mr_trade, Today, 01:32 PM
                    0 responses
                    Last Post mr_trade  
                    Started by sgordet, Today, 10:44 AM
                    1 response
                    Last Post bltdavid  
                    Started by Parmenides48, Today, 08:37 AM
                    2 responses
                    Last Post Parmenides48  
                    Started by EnveousColnago, 08-06-2020, 08:31 AM
                    8 responses
                    Last Post Emma1
                    by Emma1
                    Started by dieci, Today, 08:50 AM
                    0 responses
                    Last Post dieci
                    by dieci