Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IOrder error codes and their use.

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

    IOrder error codes and their use.

    I would like to ask, when the error codes in IOrder are set?
    I looked in documentation, but did'nt find a explanation..

    I mean these error code in IOrder:
    • ErrorCode.OrderRejected
    • ErrorCode.Panic
    • ErrorCode.ServerConnectionIsBroken
    • ErrorCode.UnableToCancelOrder
    • ErrorCode.UnableToChangeOrder
    • ErrorCode.UnableToSubmitOrder
    • ...others...


    I expect, that when any order is Rejected, then Error property is filled with more detailed information about the rejection. Am I right ?

    Can these details be used to differentiate between different types
    of order rejection ? I mean for example differentiation between rejection of invalid order VS rejection of unsuccessful change VS ... other causes of order-rejection...

    #2
    Hello misova,

    Thank you for your post.

    The ErrorCodes will only list what is in the Help Guide. The information on why a rejection occurs is provided by the brokerage technology, if at all. Some providers may details the rejection reason or may just provide a code back. Generally this is detailed in the Log. I am not aware of any way to pull the message form the API/brokerage technology into the NinjaScript code.

    Comment


      #3
      Hi,
      Can you please clarify on which OrderState will the Error field contain value other than ErrorCode.NoError?

      In addition, it would be very helpful if you can explain the following ErrorCodes:
      ErrorCode.LoginFailed
      ErrorCode.InvalidInstrument
      ErrorCode.Panic
      ErrorCode.UserAbort

      Comment


        #4
        Hello ToMer_K,

        Thank you for your post.

        NoError would be provided when the details of the error are not provided.
        LoginFailed would be provided when a login fails to connect.
        InvalidInstrument would be provided when the instrument is not supported by the account, exchange or broker.
        Panic would be provided when the brokerage technology returns a Panic message. The causes for a panic message can vary.
        UserAbort would be provided when the user manually aborts the connection or order.

        Please let me know if you have any questions.

        Comment


          #5
          Thanks but I still didn't get the answer for the first question:
          Can you please clarify on which OrderState will the Error field contain value other than ErrorCode.NoError?
          You haven't specified all the order states that may contain or always contain ErrorCodes.

          Comment


            #6
            Hello,

            Thank you for the reply.

            Unfortunately there is no "list" that details each state with its possibilities. There is a list of possible error codes that could be associated with an IOrder here: http://ninjatrader.com/support/helpG...tsub=ErrorCode

            Because both the ErrorCode and OrderState are objects of IOrder and ErrorCode is not an object of OrderState, the possibility could potentially be any of the listed error codes in any state.

            I look forward to being of further assistance.

            Comment


              #7
              Originally posted by misova View Post
              I would like to ask, when the error codes in IOrder are set?
              I looked in documentation, but did'nt find a explanation..

              I mean these error code in IOrder:
              • ErrorCode.OrderRejected
              • ErrorCode.Panic
              • ErrorCode.ServerConnectionIsBroken
              • ErrorCode.UnableToCancelOrder
              • ErrorCode.UnableToChangeOrder
              • ErrorCode.UnableToSubmitOrder
              • ...others...


              I expect, that when any order is Rejected, then Error property is filled with more detailed information about the rejection. Am I right ?

              Can these details be used to differentiate between different types
              of order rejection ? I mean for example differentiation between rejection of invalid order VS rejection of unsuccessful change VS ... other causes of order-rejection...
              Looking at the log to examine an IOrder, then using Intellisense, you will see that there is a string property called NativeError, that you can query for the exact error message. As always, as it is undocumented, it also means that it is unsupported. Caveat Emptor.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              599 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              344 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              558 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              557 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X