You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to launch a sample to connect to IBKR using IB Gateway Container but I receive this error :
API connection failed: TimeoutError()
Traceback (most recent call last):
File "C:\Python39\lib\asyncio\tasks.py", line 688, in _wrap_awaitable
return (yield from awaitable.await())
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python39\lib\asyncio\tasks.py", line 490, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
python.exe app.py
============
Traceback (most recent call last):
File "C:\Users\KN6353\source\repos\stock-market\app.py", line 5, in
ib.connect('127.0.0.1', 4002, clientId=1)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 279, in connect
return self._run(self.connectAsync(
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 318, in _run
return util.run(*awaitables, timeout=self.RequestTimeout)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\util.py", line 341, in run
result = loop.run_until_complete(task)
File "C:\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 1748, in connectAsync
await self.client.connectAsync(host, port, clientId, timeout)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\client.py", line 217, in connectAsync
await asyncio.wait_for(self.apiStart, timeout)
File "C:\Python39\lib\asyncio\tasks.py", line 492, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
Hello,
I tried to launch a sample to connect to IBKR using IB Gateway Container but I receive this error :
API connection failed: TimeoutError()
Traceback (most recent call last):
File "C:\Python39\lib\asyncio\tasks.py", line 688, in _wrap_awaitable
return (yield from awaitable.await())
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python39\lib\asyncio\tasks.py", line 490, in wait_for
return fut.result()
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
python.exe app.py
============
Traceback (most recent call last):
File "C:\Users\KN6353\source\repos\stock-market\app.py", line 5, in
ib.connect('127.0.0.1', 4002, clientId=1)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 279, in connect
return self._run(self.connectAsync(
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 318, in _run
return util.run(*awaitables, timeout=self.RequestTimeout)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\util.py", line 341, in run
result = loop.run_until_complete(task)
File "C:\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete
return future.result()
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\ib.py", line 1748, in connectAsync
await self.client.connectAsync(host, port, clientId, timeout)
File "C:\Users\KN6353\source\repos\stock-market.venv\lib\site-packages\ib_insync\client.py", line 217, in connectAsync
await asyncio.wait_for(self.apiStart, timeout)
File "C:\Python39\lib\asyncio\tasks.py", line 492, in wait_for
raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError
Logs inside IB Gateway Container
======================
ib-gateway-1 | 2023/09/18 06:41:00 socat[167] E connect(5, AF=2 127.0.0.1:4000, 16): Connection refused
App.py
=====
from ib_insync import *
ib = IB()
ib.connect('127.0.0.1', 4002, clientId=1)
contract = Forex('EURUSD')
bars = ib.reqHistoricalData(
contract, endDateTime='', durationStr='30 D',
barSizeSetting='1 hour', whatToShow='MIDPOINT', useRTH=True)
df = util.df(bars)
print(df)
Thanks for your help !
The text was updated successfully, but these errors were encountered: