IB TWS & TWS API

Discussion in 'Interactive Brokers' started by madgey, Jul 17, 2018.

  1. madgey

    madgey

    Since the update when running the following Python script the software keeps disconnecting and attempting to reconnect in a continuous loop.

    - ProgramOrdersOnly.py

    The last version of this worked pretty well, but not so much now.

    If anyone has any ideas at all, I'd really appreciate any and all suggestions.
     
  2. d08

    d08

    Where's that from? It's not included in the standard samples dir.
     
  3. Lee-

    Lee-

    I'd double check the API port and the allowed hosts settings. Perhaps they got reset to defaults and are disallowing connections from your script's IP or the port is different from before.

    File -> Global Configuration -> API -> Settings
    Specifically "Socket Port", "Trusted IPs", and "Allow connections from localhost only", but really double check everything on that page.

    Is it establishing the connection successfully and then disconnecting or outright refusing to establish?
     
  4. madgey

    madgey

    It's connecting successfully and then disconnecting more or less immediately and then putting up a countdown of however many seconds and attempting to try again, but seems to get stuck in a loop doing this.

     
  5. madgey

    madgey

    The TWS API does provide a number of samples of Python scripts and this is one of them.
    If you install the TWS API the files (and the one mentioned above) would be found in the following location:

    - C:\TWS API\samples\Python\Testbed\

     
  6. d08

    d08

    That's where I looked. My 9.73.07 didn't come with it.
     
  7. tommcginnis

    tommcginnis

    You might want close out, "clear the decks", and reload.
    Apparently, they rolled back the ("Steady") 963.3o this morning -- the roll-out of 972.1m appears to have been very miss-timed, or misqueued, or something.
    Lots of posts sprinkled around.

    But my re-load this morning was back to 963.3o.

    BEST WISHES!
     
  8. d08

    d08

    That's TWS, mostly irrelevant when it comes to the API which is version 973.07. He might also be using Gateway.
     
  9. tommcginnis

    tommcginnis

    "Mostly" you're right, but there is so much chatter around the web, and I personally have never seen a version *rescinded* like this, that it's pretty relevant at this point. Even TWS vis TWS_API vis IB Gateway. Somebody screwed up biggly in letting something out before it was vetted, and if it's that deep in the stack, we all need to "clean up."
     
  10. d08

    d08

    Very remote chance. If it's Gateway -> API then TWS isn't part of the equation.
     
    #10     Jul 17, 2018