Closed eric0470 closed 5 years ago
r u sure about order being submitted? it seems that u did not qualifyContracts?
r u sure about order being submitted? it seems that u did not qualifyContracts?
Yep, orders were submitted and filled. You can try to run the code by yourself to see the problem here.
Simpler version with same problem:
import asyncio
import traceback
from ib_insync import IB, Future, MarketOrder
def on_commission(trade, fill, report):
print('Commission', fill, end='\n\n')
def order_exec(trade, fill):
print('Order Exec:', fill, end='\n\n')
async def default_test():
try:
ib = IB()
ib.commissionReportEvent += on_commission
ib.execDetailsEvent += order_exec
await ib.connectAsync('192.168.1.5', 4002, 1)
print('CONNECTED')
# Make orders
contract = Future('ES', '20190621', 'GLOBEX')
buy_order = MarketOrder('BUY', 5)
ib.placeOrder(contract, buy_order)
await asyncio.sleep(3)
sell_order = MarketOrder('SELL', 5)
ib.placeOrder(contract, sell_order)
await asyncio.sleep(3)
ib.disconnect()
await asyncio.sleep(2)
except: # noqa
print(traceback.format_exc())
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(default_test())
loop.close()
Thank you for the bug report and the test case to reproduce it. The problem was a regression introduced one month ago with the addition of reqCompletedOrders.
It has been fixed in v0.9.53.
Hi, I found problem with commission report.
Connector class:
main.py
New order created in
main_test
were not caught inon_commission
. What i am doing wrong here?ib_insync 0.9.52 TWS Build 976.2k