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 bortz, 11-06-2023, 08:04 AM
              47 responses
              1,607 views
              0 likes
              Last Post aligator  
              Started by jaybedreamin, Today, 05:56 PM
              0 responses
              9 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              19 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              6 views
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              16 views
              0 likes
              Last Post Javierw.ok  
              Working...
              X