Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Inexplicable error, failed position in IB or NT?

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

    Inexplicable error, failed position in IB or NT?

    Hi NT,

    Since two weeks ago, I have an Algo working flawlessly with a little real money account in IB since it's still an experiment Algo. Technically, it has performed as designed, however this early morning, all of sudden, an inexplicable error pop up. First, I'm going to explain the flow of events.

    The Algo had a short position of 3 contracts in MES ( Micro-Emini ), then at 3.58.50 am, the Algo needs to reverse position to a new LONG position. So, first, it has to submit an order to close the Short position, then, when it's filled, it waits until IB updates net position, so afterward it submits the remaining order to open the LONG position. It's pretty straightforward and for two weeks it has worked just fine. But this morning happened the following: the Algo closed the Short, but something happened in the update of net position between IB or NT, when the new LONG order position is submitted, IB rejects it cause margin for 6 contracts !! , because IB believes that the Algo is already LONG with 3 contracts, which is not true, it's just flat.

    The error is so weird that I suspect that it might possibly be some issue in the database, so I performed a reset database and back to work, but I'm very uneasy cause perhaps it's something else with a potential repetition. What do you see and what is the solution?

    Thanks!
    Last edited by pstrusi; 11-11-2019, 08:58 AM.

    #2
    First, I'd like to advise to you do not directly quote from the log or trace files in a publicly visible area. You scraped most of your account data but I found some in your post that I needed to edit and remove. In general, it's best to contact us via email with your log and trace files for in-depth analysis of any order submission inquiries. In fact, that's what I'd prefer that you do now along with including your custom strategy if possible:
    • You can do this by going to the Control Center-> Help-> Mail to Platform Support
    • Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.
    • Please reference the following ticket number in the body of the email: 2331042 ATTN Patrick G

    Comment


      #3
      Thanks Patrick for the advise. I'm sending the files as you requested.

      One last tip that I'm thinking as probable cause. Last night there were connection losses that perhaps affected somehow internal positions numbers. I said this cause reading the log file, I see that after recovering connection, the Stoploss order tied to position, its state was tagged as "unknown" and then corrected.

      Comment


        #4
        Patrick, continuing in the search of possible causes of this issue, with your help as well as IB's, I could discard several hypotheses, and I've realized the most probable cause, a very remote situation, where a brief connection loss from IB, caused that a Stoploss order state that was active as "Working", changed to "Unknown" for a while, then once again the state changed to "Working". But this weird situation caused that when the Algo had to cancel that order, it couldn't find it, so the order remained active and lost in IB, affecting the Margin requirement of the account. It's clear that connection loss always has the potential to cause problems not only through the interruption but also when it reconnects. I think for users, is very limited what we could code in order to prevent this kind of situation. If you had more additional suggestions, I'd highly appreciate it.

        Kind regards and thanks for your help

        Comment


          #5
          I agree that the connection loss is the root cause of this symptom. Ideally we would work on mitigating connection losses instead of trying to code a solution. Here are some general network troubleshooting steps you can take that are known to help with connectivity issues:
          • Restart your modem and (if applicable) router
          • Restart your PC
          • Clear your DNS
          • If you are not already and the option is available to you, connect to the internet using an ethernet cable. Wireless connections are significantly more unreliable.
          • Ensure exceptions have been added into any firewall/antivirus/backup programs for the Documents > "NinjaTrader 8" folder.
          • If the above steps do not help, contact your ISP and let them know you are experiencing a highly unstable connection. An issue of connectivity may exist on their end.

          Comment


            #6
            Thanks for those additional suggestions, however the connection loss I talk about is that coming from IB servers because it's server-specific failure and not a general disconnection of my ISP.

            Regards

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ghoul, Today, 06:02 PM
            0 responses
            1 view
            0 likes
            Last Post ghoul
            by ghoul
             
            Started by Barry Milan, Yesterday, 10:35 PM
            6 responses
            18 views
            0 likes
            Last Post Barry Milan  
            Started by DanielSanMartin, Yesterday, 02:37 PM
            2 responses
            13 views
            0 likes
            Last Post DanielSanMartin  
            Started by DJ888, 04-16-2024, 06:09 PM
            4 responses
            13 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by terofs, Today, 04:18 PM
            0 responses
            12 views
            0 likes
            Last Post terofs
            by terofs
             
            Working...
            X