Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reading Ninja Orders info

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

    Reading Ninja Orders info

    NT [8]:
    ]When an order is placed, a ninja Order Id gets generated and appears in the Orders tab.
    I need to read this info when ever this happens.
    From where we can read the orders placed by ninja?
    Sample code will be of great help.

    #2
    Hello ninjaexpert,

    Are you wanting to do this from an addon?

    You can subscribe to an account for order updates.

    Below is a publicly available link to an example in the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the pointer.
      From which command in the list , I can get -
      1) 'Ninjatrader generated order ID' I.e When a order is triggered at NT side through chart trader and actual fill from broker is pending. I mean at that stage of order.

      I need to get all order details the moment it is placed and still not placed by broker.

      Also Once broker gives a order ID how can I go and update in on NT side. [my broker does not provide bridge to NT right now]

      Comment


        #4
        Hello ninjaexpert,

        I am responding to you on behalf of my colleague Chelsea who is out of the office today.

        If NinjaTrader is not connected to your broker, it would get complicated to get order updates to occur. We would not be able to provide further direction for receiving updates or updated data outside of the supported built in adapters.

        Orders submitted from NinjaTrader follow a flow of Submitted > Accepted > Working > Filled. Submitted will occur locally when each other action will have to be received from the broker on a live account. You could pick up on State.Submitted in OnOrderUpdate in a strategy for strategy specific orders or subscribing to OrderUpdate in an AddOn for Orders in relation to an account.

        You could use Order objects to keep track of your orders which includes a string for tracking order ID's.

        Order objects - http://ninjatrader.com/support/helpG...n-us/order.htm

        Please let me know if I may be of further assistance.

        Comment


          #5
          Thanks.
          What are the enum values or number equivalents to the below states -

          OrderState.Initialized
          OrderState.Submitted
          OrderState.Accepted
          OrderState.TriggerPending
          OrderState.Working
          OrderState.ChangePending
          OrderState.ChangeSubmitted
          OrderState.CancelPending
          OrderState.CancelSubmitted

          Order cancellation is submitted to the broker
          OrderState.Cancelled

          Order cancellation is confirmed by the exchange
          OrderState.Rejected

          Order is rejected
          OrderState.PartFilled

          Order is partially filled
          OrderState.Filled

          Order is completely filled
          OrderState.Unknown

          Comment


            #6
            Hello ninjaexpert,

            Using the following code,
            Code:
            for(int i = 0 ; i < Enum.GetNames(typeof(OrderState)).Length; i++)
            	Print("Slot: " + i + " State: " + ((OrderState)i));
            This is the output I received:

            Slot: 0 State: Accepted
            Slot: 1 State: Cancelled
            Slot: 2 State: Filled
            Slot: 3 State: Initialized
            Slot: 4 State: PartFilled
            Slot: 5 State: CancelSubmitted
            Slot: 6 State: ChangeSubmitted
            Slot: 7 State: Submitted
            Slot: 8 State: TriggerPending
            Slot: 9 State: Rejected
            Slot: 10 State: Working
            Slot: 11 State: CancelPending
            Slot: 12 State: ChangePending
            Please let me know if I may be of further assistance.

            Comment


              #7
              ENUM value for 'Order Types'

              What are the enum values for all the 'Order Types' in the NT8

              Comment


                #8
                Hello ninjaexpert,

                You can use the same two lines to find the enum values for OrderTypes instead of OrderStates.

                For example:
                Code:
                for(int i = 0 ; i < Enum.GetNames(typeof(OrderType)).Length; i++)
                	Print("Slot: " + i + " Type: " + ((OrderType)i));
                Prints:
                Code:
                Slot: 0 Type: Limit
                Slot: 1 Type: Market
                Slot: 2 Type: MIT
                Slot: 3 Type: StopLimit
                Slot: 4 Type: StopMarket

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                126 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                69 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                42 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X