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

OrderId vs. Token

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

    OrderId vs. Token

    Hi!

    What is the difference between OrderId and Token in IOrder?

    Thanks!

    #2
    OrderID = A string representing the broker issued order id value (this value can change)

    Token = A string representing the unique id of an order (Internal NT Token so won't change from external factors like brokerages changing it on you).
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh!

      Comment


        #4
        Is this the same for NT 7? On NT 7 it seems the token is now the same as the OrderId..

        Comment


          #5
          kashmir,

          No, not the same. Token is not unique in NT7. Please see here for more information: http://www.ninjatrader.com/support/h...nt7/iorder.htm

          To check for equality you can just directly compare the IOrder objects now instead of trying to rely on ID.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Thanks for the quick reply Josh,

            Do you know why this was changed from the previous version?

            I used to use .Token to compare all my orders. Why do orders now have .orderid and .token if they are the same?

            Thanks

            Comment


              #7
              kashmir,

              OrderId and Token are not the same. Token is internally generated ID and can change as the strategy switches from historical to live. OrderId is whatever comes from the brokerage.

              There were limitations with the old approach which have been improved upon in 7 which now allows one to directly compare IOrder objects for equality. One of the things that was required to achieve this was that Token would not necessarily stay the same throughout the entire lifespan of an order anymore.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by alifarahani, Today, 09:40 AM
              6 responses
              36 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              17 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              14 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X