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 judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X