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 Kaledus, Today, 01:29 PM
          5 responses
          12 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          5 responses
          23 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by PhillT, Today, 02:16 PM
          2 responses
          7 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Working...
          X