开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Does ib_insync work with TWS 10.30?


 

Hello folks -?
I am still using ib_insync. I was using my code fine with TWS 10.19. This week I saw a message in TWS on startup asking to upgrade to TWS 10.30 as 10.19 will not be supported past March. When I start TWS 10.30 now, I see my code does not work anymore. It just sort of hangs. Below is what I get when I hit Ctrl-C to exit the program.
When I went back to TWS 10.19, the code started running again. Has anyone else tried with TWS 10.30?
?
Thanks
?
?
Traceback (most recent call last):
? File "c:\Users\rajes\tws\testib_insync.py", line 434, in <module>
? ? ib.qualifyContracts(contract)
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\site-packages\ib_insync\ib.py", line 570, in qualifyContracts
? ? return self._run(self.qualifyContractsAsync(*contracts))
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\site-packages\ib_insync\ib.py", line 318, in _run
? ? return util.run(*awaitables, timeout=self.RequestTimeout)
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\site-packages\ib_insync\util.py", line 341, in run
? ? result = loop.run_until_complete(task)
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 629, in run_until_complete
? ? self.run_forever()
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 316, in run_forever
? ? super().run_forever()
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 596, in run_forever
? ? self._run_once()
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 1854, in _run_once
? ? event_list = self._selector.select(timeout)
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 434, in select
? ? self._poll(timeout)
? File "C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 783, in _poll
? ? status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
KeyboardInterrupt
Task was destroyed but it is pending!
task: <Task pending name='Task-12' coro=<IB.qualifyContractsAsync() running at C:\Users\rajes\AppData\Local\Programs\Python\Python39\lib\site-packages\ib_insync\ib.py:1798> wait_for=<_GatheringFuture pending cb=[<TaskWakeupMethWrapper object at 0x0000023AA11C5F40>()]>>


 

No idea, but it sounds like a great time to switch over to ib_async.


 

Hi Rajeshh, I am still on ib-insync as well but my scripts work even after migration to 10.30, even orders, fills and adjustments, although I use the Gateway instead of TWS. I suggest to try Gateway and see what happens. Also remember to adjust API Settings again, sometimes they get lost with the update


 

Thanks for the response. I just tried again now and it works with TWS 10.30. When I tried originally, it was over the weekend, which is when I usually run those scripts. Will try again next weekend.


 

During the weekend, there is high chance of maintenance including scheduled downtime, so verify here before doing tests. That is probably what happened to you.


 

The interesting thing there is that within minutes of it not working on 10.30, I went back to 10.19 to see if it would work, and it did. Will keep that link handy though. Thanks.?