Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NT crashes when coming up -- what now?

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

    NT crashes when coming up -- what now?

    Help!

    I added a DisplayName override to an indicator. When I tried to load it into a chart it crashed NT -- was just silent for a bit and then vanished without any sort of error message.

    Now I cannot bring NT up. Whenever I try, it comes up partway -- showing the main window, output window, and the chart I loaded the (evidently bad) indicator into. It then hangs, fails to bring up the editor window, and after a bit silently exits.

    Is there some way I can do something, such as edit a configuration file so that it comes up without the chart window? I would expect that to succeed. Another way would be if I could edit something so it comes up in another of my workspaces. Then I could edit the offending file and be back in business.

    The other question is whether NT creates any log file or other file that the NT folks would like to see to understand how it is that it cannot come up without crashing again.

    I'm stuck and cannot do anything until I get this fixed. It's past my bedtime, so I'll see what I can figure out in the morning. Any help on what to do would be appreciated.
    Last edited by ETFVoyageur; 05-01-2024, 02:11 AM.

    #2
    The problem was solved by a certainly unsupported activity. The operative file is Documents \ NinjaTrader 8 \ workspaces \ _Workspaces.xml

    I edited that file to change the workspace name in <ActiveWorkspace> to be another of my workspaces. Then NT came up fine in the workspace I changed to. That allowed me to comment out my recent change and rebuild the DLL. Then I changed back to the workspace that had stopped working ... and it came up just fine.

    So, I am back in business. It's pretty scary that my code went through the compiler just fine but put NT in an unusable state. Here is the code I commented out to get back in operation. I see the problem -- I was merging a couple of things and overlooked that I had made an infinite recursion of DisplayName calling itself. Oops. Mea culpa. I don't know whether or not there is anything NT can do to protect itself against that, but it would be nice if it could. Or at least provide some sort of diagnostic message.
    Code:
           public override string DisplayName
            {
                get
                {
                    string s = (Instrument == null)
                        ? string.Format("{0}", DisplayName)
                        : string.Format("{0}( {1} ) =={2}==", DisplayName, Instrument.FullName, Name );
                    return s;
                }
            }
    
    ​
    Last edited by ETFVoyageur; 05-01-2024, 03:30 AM.

    Comment


      #3
      Hello ETFVoyageur,

      It's expected that an infinite loop is going to halt NinjaTrader or any other program. Unfortunately, this is not something we can prevent
      It is the developers job to write valid code and logic.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        It's expected that an infinite loop is going to halt NinjaTrader or any other program. Unfortunately, this is not something we can prevent
        It is the developers job to write valid code and logic.​
        Understood. The frustrating part was that it prevented NinjaTrader from ever again coming up so I could fix the problem. I had to find the Xml configuration file and edit that before I could bring NinjaTrader up to fix the problem. I'm just lucky I had an alternative workspace to set when I edited the Xml file. I don't know what I would have done if I had only the one workspace.

        Comment


          #5
          Hello ETFVoyageur,

          We generally just advise moving the workspace files out of the filesystem for a start (such as temporarily moving them to the desktop), and then moving them back to the workspaces folder once NinjaTrader is started up.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            I guess that having a way to bring up NT in a "safe mode" would work, but is needed rarely enough that it is not worth the engineering effort to implement?

            Comment


              #7
              Hello ETFVoyageur,

              Hold Ctrl when clicking the NinjaTrader icon to open in Safe mode.

              Note, that Safe mode means no script editing, and no scripts will load.
              Help guide: Introduction > Using 3rd Party Add-Ons > ​TemporarilyDisablingAdd-Ons
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sofortune, Today, 10:19 PM
              0 responses
              5 views
              0 likes
              Last Post sofortune  
              Started by sofortune, Today, 10:10 PM
              0 responses
              3 views
              0 likes
              Last Post sofortune  
              Started by sofortune, Today, 09:49 PM
              0 responses
              4 views
              0 likes
              Last Post sofortune  
              Started by trader_by_day, Today, 09:37 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by trader_by_day, Today, 09:25 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X