Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can I intercept Ninja errors?

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

    Can I intercept Ninja errors?

    Is it possible to intercept Ninja errors (resulting in an error pop-up) inside the strategy?

    #2
    Originally posted by boaza View Post
    Is it possible to intercept Ninja errors (resulting in an error pop-up) inside the strategy?
    Like which error?

    Comment


      #3
      Unable to change order ,'xxxx': Order was not in a state that can be modified

      Comment


        #4
        Originally posted by boaza View Post
        Unable to change order ,'xxxx': Order was not in a state that can be modified
        Use a try ... catch block around your order, trapping the specific exception (look in the log for details), or just the general exception. Remember to use a finally block to handle what you want to do to cleanup/react after you trap the exception.

        You may also have to turn off standard realtimeerrorhandling.

        ref: http://www.ninjatrader.com/support/h...orhandling.htm

        Kindly take the dire warnings seriously. You can cause tremendous harm to your account, even possibly complete accounticide (if we may be allowed to coin our own words).
        Last edited by koganam; 08-10-2014, 04:06 PM.

        Comment


          #5
          Hello boaza,

          Thank you for your post.

          For information on Try Catch please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=9825

          Please let me know if you have any questions.

          Comment


            #6
            Thanks koganam.

            Are you sure this kind of error results in an exception?
            If yes - its clear about the try-catch. If not - will I get a call to OnOrderUpdate() with OrderStatus == Error?

            Comment


              #7
              Originally posted by boaza View Post
              Thanks koganam.

              Are you sure this kind of error results in an exception?
              If yes - its clear about the try-catch. If not - will I get a call to OnOrderUpdate() with OrderStatus == Error?
              It is more a matter of general principle rather than me being certain. Almost any error that throws up a dialog box in .NET does it by using exceptions. Actually it seems to be the only valid way to gracefully handle errors in .NET.

              The only way to know if the error gets reflected in any other event handler is to look in the log. You may have to enable TraceOrders.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              106 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              54 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              36 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              38 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              74 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X