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 AaronKoRn, Today, 09:49 PM
          0 responses
          10 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Today, 08:42 PM
          0 responses
          9 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Today, 07:51 PM
          0 responses
          10 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,980 views
          3 likes
          Last Post jhudas88  
          Started by rbeckmann05, Today, 06:48 PM
          0 responses
          9 views
          0 likes
          Last Post rbeckmann05  
          Working...
          X