Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicate OrderID Issue in NinjaTrader integration with Interactive Broker

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

    Duplicate OrderID Issue in NinjaTrader integration with Interactive Broker

    See the trace file extract below. Why am I getting this error.

    As per NinjaTrader 8 documentation internal OrderID is sent to the API by NinjaTrader and when Broker has the OrderID , internalOrderID is replaced by Broker supplied OrderID.
    As per Interactive Brokers API support forums, it expects unique OrderID or no OrderID in the API call or else it returns Duplicate OrderID error.

    Does NinjaTrader not generate a GUID e.g.
    '1bce9181776e4fb0b538b157fd3f2298'
    in the below log as OrderID , if so why I am getting this error, what can I do so this error does not occur.




    2019-09-23 10:03:23:064 (My Interactive Brokers1) Cbi.Account.CreateOrder: orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Initialized instrument='PG' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=50 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2019-09-23 10:03:23' gtd='2099-12-01' statementDate='2019-09-23' id=-1 comment=''
    2019-09-23 10:03:23:205 (My Interactive Brokers1) Cbi.Account.Submit0: realOrderState=Initialized isPendingSubmit=False orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Initialized instrument='PG' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=50 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=15902 time='2019-09-23 10:03:23' gtd='2099-12-01' statementDate='2019-09-23'
    2019-09-23 10:03:23:205 (My Interactive Brokers1) Cbi.Account.Submit1: realOrderState=Initialized orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Initialized instrument='PG' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=50 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=15902 time='2019-09-23 10:03:23' gtd='2099-12-01' statementDate='2019-09-23'
    2019-09-23 10:03:23:205 (My Interactive Brokers1) Cbi.Account.Submit0: realOrderState=Initialized isPendingSubmit=True orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Initialized instrument='PG' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=50 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=15902 time='2019-09-23 10:03:23' gtd='2099-12-01' statementDate='2019-09-23'
    2019-09-23 10:03:23:221 (My Interactive Brokers1) IB.Adapter.Submit0: count=1
    2019-09-23 10:03:23:221 (My Interactive Brokers1) IB.Adapter.Submit: orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Initialized instrument='PG' orderAction=Buy orderType='Market' limitPrice=0 stopPrice=0 quantity=50 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=15902 time='2019-09-23 10:03:23' gtd='2099-12-01' statementDate='2019-09-23'
    2019-09-23 10:03:24:736 (My Interactive Brokers1) Cbi.Account.OrderUpdateCallback: realOrderState=Submitted orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Submitted instrument='PG' orderAction=Buy limitPrice=0 stopPrice=0 quantity=50 orderType='Market' filled=0 averageFillPrice=0 time='2019-09-23 10:03:24' statementDate='2019-09-23' error=NoError comment='' nr=1
    2019-09-23 10:03:24:736 (My Interactive Brokers1) IB.Adapter.OnError: id=2 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'
    2019-09-23 10:03:24:768 (My Interactive Brokers1) IB.Adapter.OnError: id=3 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'
    2019-09-23 10:03:24:799 (My Interactive Brokers1) IB.Adapter.OnError: id=4 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'
    2019-09-23 10:03:54:985 (My Interactive Brokers1) Cbi.Account.AccountItemUpdateCallback: account='U2480064' accountItem=BuyingPower currency=UsDollar value=*****
    2019-09-23 10:03:54:985 (My Interactive Brokers1) Cbi.Account.AccountItemUpdateCallback: account='U2480064' accountItem=MaintenanceMargin currency=UsDollar value=*****
    2019-09-23 10:03:54:985 (My Interactive Brokers1) Cbi.Account.AccountItemUpdateCallback: account='U2480064' accountItem=LookAheadMaintenanceMargin currency=UsDollar value=*****
    2019-09-23 10:03:54:985 (My Interactive Brokers1) IB.Adapter.OnPortfolioValue1
    2019-09-23 10:03:54:985 (My Interactive Brokers1) IB.Adapter.OnPortfolioValueNow: accountName='U2480064' IbContract='MSFT|' avgCost=137.38 position=50 exchange='' primaryExchange='NASDAQ'
    2019-09-23 10:03:54:985 (My Interactive Brokers1) IB.Adapter.OnPortfolioValue1
    2019-09-23 10:03:54:985 (My Interactive Brokers1) IB.Adapter.OnPortfolioValueNow: accountName='U2480064' IbContract='CRM|' avgCost=155.44 position=100 exchange='' primaryExchange='NYSE'
    2019-09-23 10:03:55:001 (My Interactive Brokers1) Cbi.Account.AccountItemUpdateCallback: account='U2480064' accountItem=NetLiquidationByCurrency currency=UsDollar value=*****
    2019-09-23 10:03:55:001 (My Interactive Brokers1) IB.Adapter.OnError: id=41 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'
    2019-09-23 10:03:56:970 (My Interactive Brokers1) IB.Adapter.OnError: id=42 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'
    2019-09-23 10:03:57:001 (My Interactive Brokers1) IB.Adapter.OnError: id=43 errorCode='DuplicateOrderID' errorMessage='Duplicate order id'

    2019-09-23 10:03:57:376 (My Interactive Brokers1) IB.Adapter.OnError: id=53 errorCode='OrderModifiedDoesNotMatch' errorMessage='Order being modified does not match original order'
    2019-09-23 10:03:57:376 (My Interactive Brokers1) Cbi.Account.OrderUpdateCallback: realOrderState=Rejected orderId='1bce9181776e4fb0b538b157fd3f2298' account='U2480064' name='Entry' orderState=Rejected instrument='PG' orderAction=Buy limitPrice=0 stopPrice=0 quantity=50 orderType='Market' filled=0 averageFillPrice=0 time='2019-09-23 10:03:57' statementDate='2019-09-23' error=OrderRejected comment='Order being modified does not match original order' nr=2

    #2
    Hello vivekniwas,

    Thank you for your note.

    Please follow the steps below to manually attach your log and trace files to an email to platformsupport[AT]ninjatrader[DOT]com with "ATTN CHRIS S 2285500" in the subject line so I may investigate this matter further.
    • Open your NinjaTrader folder under Documents.
    • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
    • Send the 2 compressed folders as attachments to this email.
    • Once complete, you can delete these compressed folders.
    I look forward to your reply.

    Comment


      #3
      Sent as per instructions above.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      65 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      41 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      23 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      26 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X