Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IB TWS execution / api lag

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

    IB TWS execution / api lag

    So, I've known about this issue for a _long_ time (years), but it really bugged me today. I have a couple brokerage accounts I use. 1 is IB, 1 is NT's own.

    I have 100% got the correct setup, correct TWS versions, tried gateway (which IS faster) and tws, which I need for the options etc. Execution via NT's own brokerage is far, far quicker than via IB. I am talking about noticeably different, i.e. submit order, see it go orange, wait up to 1 or 2 seconds via tws sometimes, and then it's working. MUCH faster and less problematic via ib gateway, but otherwise same setup, and again, a noticeable upgrade in speed when sending orders via nt/dorman. I'm not however changing my broker setup just yet. I'd prefer to improve it. Latency is important to me. I scalp. 1 second delays are detrimental to my wealth!

    I'm guessing the majority of people may not notice / be as performance centric as I am, but perhaps someone that uses IB / has noticed this? Perhaps someone has workaround? Over the years, I tried all the known performance tweaks etc.

    Perhaps NT might comment if they have profiled the expected performance of the various broker api's? Maybe ib tws is known to be slower (via it's java api, then back through another gateway) than the more direct interface that nt brokerage might use, etc.

    Point for the post - The difference in time to get an order from NT8 working at the exchange is very, very much slower via IB tws, bit faster via IB gateway, and bit faster still (acceptable even!), via NT broker/dorman. If anyone knows of a way to improve execution times via IB tws api / NT, or things to check, please share.

    Thanks!

    #2
    Hello pjsmith,

    Thank you for your post.

    Generally your latency issues are controlled by two things, the quality of your internet connection and distance to the server executing your trades. These issue could have many causes:
    • Underpowered PC (generally not the case)
    • Local internet issues
    • Connection delays or issues along your connection route to the server
    • Firewalls filtering your requests.
    Additionally when using the IB API, orders are submitted to TWS or IB Gateway from the Platform almost instantaneously, or as fast as your PC would allow, it is them dependant upon the TWS interface/IB's servers to process the signals and submit your orders.

    On the Local or NinjaTrader side to resolve this, I recommend the following steps (test for the issue after each step):
    • Restart NinjaTrader
    • 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 as these will filter and slow down requests.
    You may also look to information from other users, Please let us know if we may assist you further.
    Heath R.NinjaTrader Customer Service

    Comment


      #3
      but in this case, as it's the same PC, same internet connection, same software, just a different API, these things do not apply. As stated, been an issue for _years_. Am a microsoft certified systems engineer, Not that I don't make mistakes, but I know the basics! lol. Scripted responses... Damn I hate them.

      Comment


        #4
        Hello pjsmith,

        Thank you for your reply.

        I assure you that was not a scripted response. I personally wrote it out for you. I would recommend reaching out to Interactive Brokers directly to see if they have tips to reduce latency when transmitting orders via their API.

        It's typical to have some latency in a connection due to light delay, even on the fastest connections a delay is expected.

        I've personally worked with some users who run NinjaTrader from a VPS closer to the exchange to overcome latency due to distance from their platform. However, we're unable to recommend a specific service.

        Perhaps the other users in the forum would have some additional recommendations.
        Heath R.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by funk10101, Today, 12:02 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by GLFX005, Today, 03:23 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by nandhumca, Yesterday, 03:41 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by The_Sec, Yesterday, 03:37 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by vecnopus, Today, 06:15 AM
        0 responses
        1 view
        0 likes
        Last Post vecnopus  
        Working...
        X