Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 asd32, Today, 11:45 AM
          0 responses
          1 view
          0 likes
          Last Post asd32
          by asd32
           
          Started by tkaboris, Today, 11:09 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by marco231, 03-20-2024, 03:56 PM
          5 responses
          155 views
          0 likes
          Last Post bnoisette  
          Started by tonynt, Today, 08:05 AM
          2 responses
          17 views
          0 likes
          Last Post tonynt
          by tonynt
           
          Started by victor68133, Today, 07:50 AM
          4 responses
          26 views
          0 likes
          Last Post backtester831  
          Working...
          X