Closed JustinGirard closed 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')
https://ib-insync.readthedocs.io/api.html#ib_insync.ib.IB.sleep
GREAT!!! thank you.
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')