Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

best way to debug nt7 crashes

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

    best way to debug nt7 crashes

    what is the best way to debug continual nt7 crashes?

    CLR Debugger reports this:
    An unhandled exception of type 'System.StackOverflowException' occurred in NinjaTrader.Custom.dll

    so i know that it's my custom indicator ... crash happens when i apply that indicator to a chart ... but it compiles with no errors; hence the confusion.

    i have checked the nt7 logs (in the log directory) and the trace files for zen-fire, but there is no indication of what is breaking or causing the fault.

    is there a switch or registry setting to enable more detailed logging?

    cheers,
    -e
    Last edited by e-man; 11-13-2009, 09:51 AM.

    #2
    attach CLR debugger to the NinjaTrader process!
    load your .cs file in CLR deb
    then compile .cs with debug info in NT7
    CLR debugger will ask to reload .cs

    then add your indicator to a chart and if there is an exception CLR will trap it and highlight the line in the .cs file

    Comment


      #3
      Educated guess: is this an indicator which you did not edit on NS editor? Then you probably have coded an incorrect property like
      Code:
      public double MyProperty
      {
          get { return [COLOR=Red][B]M[/B][/COLOR]yProperty; }       // recursive call here
          set { [B][COLOR=Red]M[/COLOR][/B]yProperty = value; }     // recursive call here as well
      }

      Comment


        #4
        thanks guys! i got the CLR setup, and Dierk you are close ... i did actually edit in the NS compiler, but this is the part of the file where it's breaking:

        Code:
                public int SignalStop
                {
                    get { return iSignalStop; }
                    set
                    {
                        iSignalStop = Math.Max(0, value);
                        SignalTrailStop = iSignalStop > 0 ? 0 : iSignalTrailStop;
                    }
                }
        the property for SignalTrailStop looks similar to SignalStop, just with the second line under set{} reversed.

        what i'm trying to achieve here is that if a Stop is specified, it clears out the TrailingStop and visa versa.

        based on Dierk's comment about recursion, i changed that second line to read:
        Code:
        iSignalTrailStop = iSignalStop > 0 ? 0 : iSignalTrailStop;
        and adjusted the set{} for SignalTrailStop as well.

        it compiled and now doesn't throw the error, so many thanks, guys!

        not sure if the NS compiler is supposed to detect for recursion, but i might have thrown it off since i was recursively updating another property?

        cheers,
        -e

        Comment


          #5
          Glad it's resolved for you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          621 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          567 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X