Closed enricoangelelli closed 9 months ago
This is a problem I have with any notebook using a ib_insync connection to TWS. I report a minimal example.
After executing cell
import ib_insync ib_insync.util.startLoop() ib = ib_insync.IB() ib.connect('127.0.0.1', 7497, clientId=11) contract = ib_insync.Stock('AMZN', 'SMART', 'USD') ib.qualifyContracts(contract) display(contract) ib.disconnect()
the next cell
print("Hello")
remains pending. I cannot even execute again the same cell.
Thank you in advance for any help.
Enrico
try replacing display(contract) with print(contract)
display(contract)
print(contract)
I tried, but unfortunately it does not work.
You can try upgrading to the latest nest_asyncio.
nest_asyncio
Yeeeessss! It works. Thank you very much!
This is a problem I have with any notebook using a ib_insync connection to TWS. I report a minimal example.
After executing cell
the next cell
remains pending. I cannot even execute again the same cell.
Thank you in advance for any help.
Enrico