Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Documentation Clarification: OrderId not unique

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

    Documentation Clarification: OrderId not unique

    Documentation Clarification: The property <Order>.OrderId is NOT a unique value, since it can change throughout an order's lifetime.


    My strategy is always going to start when the Account/Instrument is flat....no orders will be placed until State.RealTime

    So, in this case is OrderId static and will not be changed?

    Under what circumstances doe the OrderId change?

    #2
    Hello vantojo,

    An order id will change as it comes back from a broker in real-time.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea

      1) How does this relate to GetRealtimeOrder()?

      2) How do I get the broker supplied order?

      3) OnOrderUpdate?

      4) How does this relate to CancelOrder()? Do I need the broker supplied order to CancelOrder(), or the order assigned by Ninja when the order was placed/submitted?

      sorry, but the documentation is not clear to me...

      Comment


        #4
        Hello vantojo,

        This would not relate to GetRealtimeOrder(). GetRealtimeOrder() is used when an order is submitted in historical data, is still working in real-time data, and you want to modify the order.


        The order will update in OnOrderUpdate() with the new OrderID.

        Yes, OnOrderUpdate() will run each time the order changes states.

        This does not relate to CancelOrder(). CancelOrder() will cancel an order, no matter what the ID is, by supplying an order object.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok I get it...duh.

          The Order object contains the Order Id.

          Order Id is not used to CancelOrder(), the Order object is used.

          My code is ok.

          thanks

          :-)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X