Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fix for "Object reference not set to an instance of an object" when starting up NT

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

    Fix for "Object reference not set to an instance of an object" when starting up NT

    Hey everyone, I just wanted to let you all know that I was able to figure out how to fix the dreaded "Unhandled Exception: Object reference not set to an instance of an object." error when starting up NinjaTrader. For our purposes, this is an issue with a Workspace (others encounter it in other scenarios) coupled with the database that NinjaTrader uses (there is a database file on our computers that NinjaTrader creates and uses). If you want this fix to work for you in the future, you NEED to start taking daily NinjaTrader backups religiously. Here's what I did:

    1) Before the issue crops up, take a NinjaTrader backup everyday. It's really easy:
    a) Disconnect all "Connections"
    b) Click "Tools->Export->Backup File..."
    c) Make sure "Configuration files", "Database", "NinjaScript files", "Templates", and "Workspaces" are checked
    d) Click "Export"
    e) Give the file a name and what folder it should be saved in
    f) Click "Save"
    2) Now that you've encountered the error when NinjaTrader starts, shut down NinjaTrader
    3) Navigate to your folder where your NinjaTrader backups are kept
    4) Make sure that file name extensions are visible:
    a) In your folder Explorer window, click the "View" menu
    b) Make sure "File name extensions" is checked
    5) Make a copy of the most recent backup file
    6) Rename the the copied file from "<yourfilename>.nt8bk" to "<youfilename>.zip"
    7) Double-click on the Zip file and within the file now double click on the "db" folder
    8) Right-click the "Ninjatrader.sqlite" file and select "Copy"
    9) Open up another file Explorer window and navigate to this folder: "C:\Users\<Windows user>\Documents\NinjaTrader 8\db"
    10) Right-click the "Ninjatrader.sqlite" file and rename it to "Ninjatrader.old"
    11) Right-click in the folder and select "Paste" to paste in the new "Ninjatrader.sqlite" file
    12) Open up NinjaTrader and the issue should be fixed! If it is not (which happened to me), you'll need to do this same process on your next most recent NinjaTrader backup file

    NOTE that using this backup database will fix the issue, however your most recent trade performance results will not be part of the database any longer. A trade-off, but worth it to get this annoying issue fixed.

    Cheers!​

    #2
    Originally posted by hardworkinguy View Post
    NOTE that using this backup database will fix the issue.
    Welcome to the forums!

    Many things could be causing that error message.

    Following those steps to fix the issue you're having is coincidental.

    Even by your own admission, those steps do not really 'fix' the error,
    because you've had to do these procedures more than once, and
    you're still seeing the problem occur again.

    My point is:
    Something else is going on, and you should continue to pursue this
    error message with NT Support.

    -=o=-

    Which version of NT are you using?
    When the error occurs, have you sent your log/trace files to Support?

    Just my 2˘.


    Comment


      #3
      Hello hardworkinguy,

      Thank you very much for your post and welcome to the NinjaTrader forums!

      If these errors occur, it would usually indicate an issue with the workspace or an indicator directly.

      While these steps can resolve specific issues, we would also be happy to take a closer look at what might be causing this error to recur.

      As mentioned by bltdavid, please don't hesitate to reach out to us via the Help > Email Support menu if you would like us to investigate this further.

      We look forward to your email!
      Manfred F.NinjaTrader Customer Service

      Comment


        #4
        I'm having this issue constantly when I press the "shift" key. It's really weird, doesn't happen every single time, but most of the time. I use the hotkey shift + F3 to change my workspace, as I use two, and change between them regularly. And it's being very annoying lately, as this error is raised with no apparent reason. I recreated my workspaces from zero, changed some charts and stuff to try to get rid of the problem but it persists

        Any help?

        Comment


          #5
          Hello DonMiguelo ,

          Thank you very much for your post.

          Could you send us your log & trace files? We can then take a closer look at any reported errors or issues.

          You can do this by going to the Control Center -> Help -> Email Support

          Please select "Platform Technical Support" as the recipient and enter a brief note in the message referring to this post.

          Thank you in advance, I look forward to your email!​
          Manfred F.NinjaTrader Customer Service

          Comment


            #6
            Hi NinjaTrader_Manfred,

            I just sent the email, the subject is: Requested Log & Trace Files for post: post1294054

            Thanks for your support! I'll be happy to help if there are any further inquiries.

            Comment


              #7
              Originally posted by DonMiguelo View Post
              Hi NinjaTrader_Manfred,

              I just sent the email, the subject is: Requested Log & Trace Files for post: post1294054

              Thanks for your support! I'll be happy to help if there are any further inquiries.
              Hi, you ever got this solved? Having the exact same problem - only when pressing shift on any chart on any template...
              Thanks

              Comment


                #8
                Hello Veryangrychair,

                Thank you very much for your post and welcome to the NinjaTrader forums!

                As the cause of this error can differ greatly, please don't hesitate to send us your log and trace files so we can examine them as well.

                You can do this through the Control Center -> Help -> Email Support.

                Please select "Platform Technical Support" as the recipient and enter a brief note in the message referring to this post. One of our technicians will then follow up with you.

                The above issue was resolved by renaming the database file; this causes NinjaTrader to create a new one.

                To do this, please follow the steps below. However, please note that we cannot guarantee this will resolve the issue, as it might be caused by a different error.
                • Shutdown NinjaTrader and Go to the Start Menu
                • Select My Documents > NinjaTrader 8 > db > "NinjaTrader.sqlite" file (may only say 'NinjaTrader' depending on your Windows File Explorer settings)
                • Right-click on NinjaTrader.sqlite and select "Rename"
                • Name it "OLDNinjaTrader.sqlite"
                • Restart the software and NinjaTrader will create a fresh database file to use
                I have also included a brief walk-through video that demonstrates this process:
                World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


                Please note, this resets the following information to default values:
                • Trading Hours templates
                • Instrument Lists
                • Custom Instruments
                • Historical trade execution data for locally-simulated accounts (e.g. Sim101)
                • Saved Strategy Analyzer backtest results
                ​Please don't hesitate to let me know if I may be of further assistance!
                Manfred F.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Manfred

                  I am having the same issue using NT 8.1.3.0 64-bit. I am using the SIM 101 database for back testing and have added a text box to a particular chart. Whenever I change the location of the box to accommodate some extra text I get the " Object reference not set to an instance of an object" error. I have renamed the database file and restarted NT8 but the result is the same. Could you give me your thoughts as to the next thing to try as happening continually now.

                  Many thanks

                  David​

                  Comment


                    #10
                    Hello DavidHunter,

                    Thank you for your post.

                    What you are describing may be isolated to the workspace you are using.
                    If you would like, we can review your log and trace files and investigate further.
                    Please email us at Support [AT] NinjaTrader [DOT] com.
                    In your message, please include a link to this forum thread and a message 'ATTN Eduardo'. Additionally, please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.
                    • Open your NinjaTrader folder under My Documents.
                    • Right-click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
                    • Send the 2 compressed folders as attachments to this email.
                    • Once complete, you may delete these compressed folders.
                    Thanks in advance; I look forward to resolving this item.
                    Eduardo R.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by JackyP, 07-25-2023, 08:39 AM
                    3 responses
                    312 views
                    0 likes
                    Last Post Lancer
                    by Lancer
                     
                    Started by TiffanyMiller, Yesterday, 10:19 PM
                    0 responses
                    2 views
                    0 likes
                    Last Post TiffanyMiller  
                    Started by algospoke, 05-13-2024, 06:53 PM
                    12 responses
                    133 views
                    0 likes
                    Last Post algospoke  
                    Started by psangram, Yesterday, 06:35 PM
                    0 responses
                    4 views
                    0 likes
                    Last Post psangram  
                    Started by Alaina19, 07-14-2024, 04:38 PM
                    2 responses
                    16 views
                    0 likes
                    Last Post Alaina19  
                    Working...
                    X