diff --git a/piker/brokers/ib.py b/piker/brokers/ib.py index e43b5a38..2e0b92cb 100644 --- a/piker/brokers/ib.py +++ b/piker/brokers/ib.py @@ -1352,12 +1352,10 @@ async def trades_dialogue( 'contract': asdict(fill.contract), 'execution': asdict(fill.execution), 'commissions': asdict(fill.commissionReport), + 'broker_time': execu.time, # supposedly IB server fill time + 'name': 'ib', } - # supposedly IB server fill time - details['broker_time'] = execu.time - details['name'] = 'ib' - msg = BrokerdFill( # should match the value returned from `.submit_limit()` reqid=execu.orderId, @@ -1369,7 +1367,7 @@ async def trades_dialogue( broker_details=details, # XXX: required by order mode currently - broker_time=details['execution']['time'], + broker_time=details['broker_time'], ) @@ -1391,9 +1389,7 @@ async def trades_dialogue( elif event_name == 'position': msg = pack_position(item) - # msg = BrokerdPosition(**item) - # if msg.get('reqid', 0) < -1: if getattr(msg, 'reqid', 0) < -1: # it's a trade event generated by TWS usage.