Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error Report in NinjaTrader Output

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

    Error Report in NinjaTrader Output

    Dear Support,

    The current NT8 Output error reports only the bar number where an error was generated. This is perhaps OK is you have one simple chart with one indicator or add-on. However, most every trader has several charts, each with several indicators.

    An error identified by only the bar number is next to impossible to resolve without dismantling the entire workspace(s) and individual indicators to find the culprit code.

    How do you find out easily which indicator and what line caused the error? Why the Output window does not at least name the indicator causing the error?

    Many members have to go through this cumbersome error resolution. Please suggest an easy way to identify the source and location of the error. Better yet, expand on the Output report feature to include the indicator name and the line number causing the error.

    Thanks.
    Last edited by aligator; 09-18-2017, 10:47 AM.

    #2
    Hello aligator,
    I have submitted this feature request on your behalf. I will update this thread with an SFT number that you may use to reference when speaking to support about your inquiry.

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hello aligator,
      I have submitted this feature request on your behalf. I will update this thread with an SFT number that you may use to reference when speaking to support about your inquiry.
      Thank you Ryan,

      Meanwhile to make life easier, is there a way to include a "Name" line code in the indicator script so that the name of the indicator is printed in the Output error message.

      For example, I have noticed for some errors the indicator name is printed between the quotes and for others such as the following error the quotes (in Red color) following the "Indicator" are empty;

      Indicator '': Error on calling 'OnBarUpdate' method on bar 866: You are accessing an index with a value that is invalid since it is out-of-range.

      Thanks

      Comment


        #4
        Hello aligator,

        Thanks for your reply.

        Error reporting by NinjaTrader can't be modified through NinjaScript. You could add this; name to your debug prints to have them show the name of calling NinjaScript.

        We are tracking interest to add more contextual data to error reporting with the feature request ticket ID SFT-927.

        As with other feature requests, we cannot offer an ETA as they are fulfilled on the development team's schedule and priorities.

        Upon implementation, the ticket ID can be found in the Release Notes page of NinjaTrader which includes it: https://ninjatrader.com/support/help...ease_notes.htm
        Last edited by NinjaTrader_Jim; 01-24-2018, 09:05 AM.
        JimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jim View Post
          Hello aligator,

          Thanks for your reply.

          Error reporting by NinjaTrader can't be modified through NinjaScript. You could add this.Name to your debug prints to have them show the name of calling NinjaScript.

          We are tracking interest to add more contextual data to error reporting with the feature request ticket ID SFT-927.

          As with other feature requests, we cannot offer an ETA as they are fulfilled on the development team's schedule and priorities.

          Upon implementation, the ticket ID can be found in the Release Notes page of NinjaTrader which includes it: https://ninjatrader.com/support/help...ease_notes.htm
          Thank you Jim,

          I do not know if Ticket ID SFT-927 would resolve the issue described above in post #3 or not. Any idea if your Team has any interest in addressing this issue?

          But when working on several charts, each with several indicators, it is almost next to impossible to debug every parameter for every indicator on-the-fly when the error pops up in the middle of trading.

          It is really frustrating that there is no easy solution to identify the source of the error from inadequate error reporting.

          Thanks.

          Comment


            #6
            Hello aligator,

            I would expect NinjaTrader to report the indicator producing the error if the error can be traced directly from that specific indicator. If you have a specific example of an error that gets logged without the indicator name we can take a close look to see why it did not get reported with the name. (By specific example we would mean a small test case, and not an issue that would need debugging.)

            SFT-927 does request a lot of additional contextual information that can be used for debugging. In the meantime and as a tip, I would advise to put any custom indicators through strenuous testing before building a large workspace. I'd also recommend to keep a backup workspace that you could roll back to easily so you can better narrow down a new issue.

            I look forward to being of any further assistance.
            JimNinjaTrader Customer Service

            Comment


              #7
              Old thread but still at the top of google searches.

              Here's how I trap the indicator name and line number using try/catch and debug mode.


              Code:
              try{
              //Problem code 
              } catch(Exception Err){Log(Err.ToString(), LogLevel.Warning); }
              From trace file

              With compile debug mode on contains line number
              Code:
              2022-04-22 09:31:31:426 WARNING: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative
              and less than the size of the collection. Parameter name: index    at System.ThrowHelper.ThrowArgumentOutOfRange
              Exception(ExceptionArgument argument, ExceptionResource resource)    at NinjaTrader.NinjaScript.Series`1.set_Item
              (Int32 barsAgo, T value)    at NinjaTrader.NinjaScrip[B]t.Indicators.Customized.PriceMarker.OnBarUpdate()[/B] in
              c:\Users\AdminUser\Documents\NinjaTrader 8\bin\Custom\Indicators\Customized\PriceMarker.c[B]s:line 170[/B]
              With compile debug mode off does not show line number:
              Code:
              2022-04-22 09:36:17:190 WARNING: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative
              and less than the size of the collection. Parameter name: index    at System.ThrowHelper.ThrowArgumentOutOfRange
              Exception(ExceptionArgument argument, ExceptionResource resource)    at NinjaTrader.NinjaScript.Series`1.set_Item(Int32 barsAgo, T value)    
              at NinjaTrader.NinjaScript.Indicators.Customized.PriceMarker.OnBarUpdate()

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cls71, Today, 04:45 AM
              2 responses
              9 views
              0 likes
              Last Post eDanny
              by eDanny
               
              Started by proptrade13, Today, 11:06 AM
              0 responses
              2 views
              0 likes
              Last Post proptrade13  
              Started by kulwinder73, Today, 10:31 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by terofs, Yesterday, 04:18 PM
              1 response
              24 views
              0 likes
              Last Post terofs
              by terofs
               
              Working...
              X