Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

System Hanging

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

    System Hanging

    Hi,

    I have a strategy that basically buys and sell the ES using moving averages and a couple of other indicators. Trades are on Interactive Brokers. The strategy can work well for most of the day, but sometimes crashes NT8 usually when loading data after changing the the Renko bar size. (or initiating the strategy)

    Any tips on how to debug this?

    Thanks

    Ian

    #2
    Hello IanC28,

    Thank you for your post.

    When you say it crashes NinjaTrader, does it freeze everything up and then you have to force close NinjaTrader, or does it completely crash and disappear?

    What error messages do you receive when this behavior occurs, either in the Log or on screen?

    If you could post a reduced version of your strategy (you can leave out all code unnecessary to reproduce, that would be helpful.

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hi Kate,

      The chart running the strategy freezes. The rest of the system seems to be responsive, but if I were to try to save the workspace the whole system would lock. Looking at Windows Task Manager Ninjatrader runs with about 8 processes, but after a crash only 3 processes remain running.

      There is no error displayed, but the error log shows:
      "Received unknown error/warning: Sec-def data farm connection is OK secdefil"

      I get data from Kinetick.

      As I said the strategy can run for extended periods without error, so I am looking for tips to narrow down the error.The strategy is around 1,400 lines of code so sending a snippet is not easy until I can narrow down the issue.

      Can Visual Studio 2019 assist. I am no expert, but have used it to debug some code.

      Thanks

      Ian

      Comment


        #4
        Hello IanC28,

        Thank you for your reply.

        It may be beneficial to try debugging with Visual Studio.

        Here is a publicly available link on a general overview of debugging with Visual Studio:


        You can try enabling all CLR exceptions and then just run the code with the debugger attached. Once it hits an error, Visual Studio can catch that and the line it occurred on. There's more details on how to accomplish this on this forum thread here:

        I see this from time to time when I am developing on NT: 2020-02-28 11:53:07:985 ERROR: Indicator 'sjBasketTickStream': Error on calling 'OnMarketData' method on bar 184: Index was outside the bounds of the array. There are many things going on in my OnMarketData() handler. What can I do to learn, specifically where within


        Do you find that it hits any errors when debugging in this way with Visual Studio?

        Thanks in advance; I look forward to assisting you further.

        Comment


          #5
          Hi Kate,

          I couldn't find a place to enable CLR exceptions. Visual Studio did not find any exceptions.

          The issue occurs when changing symbol or the period of the chart.

          The following error message was produced when the strategy was started, but this appears infrequently.

          I reinstalled NT8.

          Thanks

          Ian
          Attached Files

          Comment


            #6
            Hello IanC28,

            Thank you for your reply.

            Along the bottom of the screen in Visual Studio you should see a few tabs, one of which is Exception Settings. Click on that, then click the Common Language Runtime Exceptions box so that it has a checkmark and not a square inside it, then try running the script.

            Thanks in advance; I look forward to assisting you further.

            Comment


              #7
              Hi Kate,

              I am still struggling to resolve this issue. I found the setting you pointed out, but I still can't trace the error.

              Any further suggestions would be helpful.

              Thanks

              Ian

              Comment


                #8
                Hello IanC28,

                Thank you for your reply.

                It's possible this may be caused by a database issue. I'd like to look at your log and trace files to see if it's recording any errors.

                Please send me your log and trace files so that I may look into what occurred.

                You can do this by going to the Control Center-> Help-> Email Support - log and trace files will be checked by default.

                Please reference the following ticket number in the body of the email: 2462393 ATTN Kate W.

                Thanks in advance; I look forward to assisting you further.

                Comment


                  #9
                  Hello IanC28,

                  Thank you for sending your log and trace files.

                  First, I see that you're using an older version of NinjaTrader 8. Since you've been having issues that could be installation/database related, let's have you do a complete uninstall and reinstall.

                  Please follow the steps listed below to completely uninstall and reinstall NinjaTrader so we can make sure that no files from the old version's back end may be causing conflicts.
                  • If possible, copy your license key from the Control Center > Help > License Key.
                  • Close all running applications.
                  • Navigate to your Documents folder > Right click on the 'NinjaTrader 8' folder > Rename > rename the folder to 'NinjaTrader 8 OLD'. DO NOT delete this folder.
                  • Uninstall NinjaTrader within Windows Control Panel.
                  • Navigate to C:\ > Program File (x86) > Delete the 'NinjaTrader 8' folder if it exists
                  • Reboot your PC.
                  • Once these steps are completed, download and install NT8 from the link below.
                  • Once reinstalled, you will now have 2 NinjaTrader folders in your Documents, the old one and the new one. Open two file explorer windows and open the new one in one and the old one in another.
                  • Drag the following items from the old folder to the new one (folders should automatically merge)
                    • Config.xml and UI.xml
                    • Workspaces folder (if it asks to overwrite the _Workspaces.xml file, say yes)
                    • Templates folder (if it asks to overwrite anything, say no)
                    • db folder (you can overwrite any files in here)
                    • bin folder (do not overwrite ANY duplicate files).
                  • Once complete, restart NinjaTrader. You may get a few initial errors. Open a NinjaScript Editor and run a compile, then, if no additional errors are received, restart NinjaTrader and test.
                  Next, I noted several error messages from your IB connection - what version of TWS are you using? You can find this on the splash screen when TWS starts up.

                  Are any of the indicators that you are using in the strategy third party indicators? If so, can you reproduce with those ruled out?

                  Is this reproducible only when connected to Interactive Brokers or can you reproduce with Playback?

                  Thanks in advance; I look forward to resolving this for you.

                  Comment


                    #10
                    Hi Kate,

                    Thanks for the above advice.

                    I have been runnig my strategies for a few days now and they seem to be running much better, but I cannot save settings.

                    I was using the Beta version of TWS, but have now moved back to
                    Build 972.1x, Feb 20, 2020 4:31:09 PM

                    Is there a file that saves settings that could be corrupt?

                    Thanks

                    Ian

                    Comment


                      #11
                      Hello IanC28,

                      Thank you for your reply.

                      The supported version of TWS for both NinjaTrader 7 and NinjaTrader 8 is currently TWS 973.2 - Download

                      I would uninstall the version of TWS you're currently using and install the one linked above - it's different from the versions you get from IB directly since it doesn't autoupdate and will stay stable.

                      As far as saving settings, which settings are you trying to save? Can you provide a screenshot?

                      Thanks in advance; I look forward to assisting you further.

                      Comment


                        #12
                        Hi Kate,

                        The settings are the template setting for indicators. If I save default settings, there is no file saved.

                        Seems to be working again, but I have often been unable to save template settings.

                        Thanks

                        Ian

                        Comment


                          #13
                          Hello IanC28,

                          Thank you for your reply.

                          The important thing when saving Default settings for indicators is to make sure you save them with the name "Default" with the D capitalized, otherwise it won't use it as the default. If you save them as any other name, it won't load them automatically and you'll have to go in the list of indicator templates and load the desired one. Are you always saving the settings as Default?

                          Thanks in advance; I look forward to assisting you further.

                          Comment


                            #14
                            Hi Kate

                            I tend to use the Save Defauls button. No matter what I type, when I go back to load a settings file the list of "saved" defaults is blank.

                            I use NT8 on two machines and have seen this effect on both machines.

                            Thanks

                            Ian

                            Comment


                              #15
                              Hello IanC28,

                              Thank you for your reply.

                              The thing I would check is to make sure you don't have any backup software like OneDrive that is backing up your NinjaTrader 8 folder in your Documents on either machine - backup software can cause templates not to save properly or at all.

                              If it's working now I wouldn't mess with it - but let us know if you start experiencing that again, as I'd like if we could check your log and trace files when it does occur to see if NinjaTrader logs any errors in relation to saving the template.

                              Please let us know if we may be of further assistance to you.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              50 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              126 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              69 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              42 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              46 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X