Move details assignements to static declaration
parent
b06cb5bb5a
commit
a9cbacd8aa
|
@ -1352,12 +1352,10 @@ async def trades_dialogue(
|
||||||
'contract': asdict(fill.contract),
|
'contract': asdict(fill.contract),
|
||||||
'execution': asdict(fill.execution),
|
'execution': asdict(fill.execution),
|
||||||
'commissions': asdict(fill.commissionReport),
|
'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(
|
msg = BrokerdFill(
|
||||||
# should match the value returned from `.submit_limit()`
|
# should match the value returned from `.submit_limit()`
|
||||||
reqid=execu.orderId,
|
reqid=execu.orderId,
|
||||||
|
@ -1369,7 +1367,7 @@ async def trades_dialogue(
|
||||||
|
|
||||||
broker_details=details,
|
broker_details=details,
|
||||||
# XXX: required by order mode currently
|
# 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':
|
elif event_name == 'position':
|
||||||
msg = pack_position(item)
|
msg = pack_position(item)
|
||||||
# msg = BrokerdPosition(**item)
|
|
||||||
|
|
||||||
# if msg.get('reqid', 0) < -1:
|
|
||||||
if getattr(msg, 'reqid', 0) < -1:
|
if getattr(msg, 'reqid', 0) < -1:
|
||||||
|
|
||||||
# it's a trade event generated by TWS usage.
|
# it's a trade event generated by TWS usage.
|
||||||
|
|
Loading…
Reference in New Issue