Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OIF error: An entry with the same key already exists.

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

    OIF error: An entry with the same key already exists.

    Can someone tell me what this crash means?

    I'm trying to use the ATI interface.

    2022-11-02 18:49:08:258 *************** unhandled exception trapped ***************
    2022-11-02 18:49:08:263 An entry with the same key already exists.
    2022-11-02 18:49:08:822 System.ArgumentException: An entry with the same key already exists.
    at System.ThrowHelper.ThrowArgumentException(Exceptio nResource resource)
    at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value)
    at NinjaTrader.Cbi.AutoTrade.FindAccountByName(String accountName)
    at NinjaTrader.Cbi.AutoTrade.ProcessPlaceAndReverse(S tring line)
    at NinjaTrader.Cbi.AutoTrade.ProcessOif(String line)
    at NinjaTrader.Cbi.AutoTrade.ProcessFile(FileSystemEv entArgs e)
    at System.IO.FileSystemWatcher.OnChanged(FileSystemEv entArgs e)
    at System.IO.FileSystemWatcher.CompletionStatusChange d(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
    at System.Threading._IOCompletionCallback.PerformIOCo mpletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    #2
    Hello Lumbeeindian17,

    Welcome to the NinjaTrader forums!

    May I confirm that each new .txt file has an enumerated file name like OIF1.txt, OIF2.txt, as directed in the help guide?


    May I confirm each new order has a unique OrderID?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes the file names are increments. For the device question I am not adding an order ID. Maybe this is my issue. I thought it was optional.

      Comment


        #4
        Hello Lumbeeindian17,

        No orderid is ok.

        May I have you send an email to platformsupport [at] ninjatrader [dot] com so I may request further information?

        Please include a link to this forum thread in the email.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I added the order id with the command below the first two trades went through fine but on the 3rd run it crashed with the same error. Maybe an issue with using powershell?

          "PLACE;;ES 12-22;BUY;2;MARKET;;;DAY;;$(get-date -f yyyyMMddHHmmss);;" | Out-File -FilePath C:\Users\OMIT\Documents"NinjaTrader 8"\incoming\oif$(get-date -f yyyy-MM-dd-HHmmss).txt

          I sent the email you requested.

          Comment


            #6
            Correction, it only worked once. It failed on the second run not the 3rd.

            Comment

            Latest Posts

            Collapse

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