erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.8k stars 743 forks source link

Order Never moves past PendingSubmit (but it gets filled in IB) #164

Closed JustinGirard closed 5 years ago

JustinGirard commented 5 years ago

from ib_insync import * util.startLoop() import time ib = IB() ib.connect(SERVER, PORT, clientId=13) contract = Stock('AAPL', 'SMART', 'USD') ib.qualifyContracts(contract) order = MarketOrder('BUY', 100) trade = ib.placeOrder(contract, order)

while not trade.isDone(): print('-----------------------') print(trade) time.sleep(1) print('Never prints')

erdewit commented 5 years ago

https://ib-insync.readthedocs.io/api.html#ib_insync.ib.IB.sleep

JustinGirard commented 5 years ago

GREAT!!! thank you.