Process unknown order mode msgs

offline_dark_clearing
Tyler Goodlet 2022-10-06 08:38:19 -04:00
parent 8cd56cb6d3
commit 4c96a4878e
2 changed files with 13 additions and 6 deletions

View File

@ -842,6 +842,11 @@ async def translate_and_relay_brokerd_events(
status_msg.reqid = reqid status_msg.reqid = reqid
status_msg.brokerd_msg = msg status_msg.brokerd_msg = msg
# TODO: if no client is connected (aka we're
# headless) we should record the fill in the
# ``.msg_flow`` chain and re-transmit on client
# connect so that fills can be displayed in a
# chart?
await router.client_broadcast( await router.client_broadcast(
status_msg.req.symbol, status_msg.req.symbol,
status_msg, status_msg,

View File

@ -433,7 +433,7 @@ class OrderMode:
size = dialog.order.size size = dialog.order.size
# NOTE: sends modified order msg to EMS # NOTE: sends modified order msg to EMS
self.book.update( self.book.send_update(
uuid=line.dialog.uuid, uuid=line.dialog.uuid,
price=level, price=level,
size=size, size=size,
@ -1047,12 +1047,12 @@ async def process_trade_msg(
case Status(resp='fill'): case Status(resp='fill'):
# handle out-of-piker fills reporting? # handle out-of-piker fills reporting?
known_order = book._sent_orders.get(oid) order: Order = book._sent_orders.get(oid)
if not known_order: if not order:
log.warning(f'order {oid} is unknown') log.warning(f'order {oid} is unknown')
return order = msg.req
action = known_order.action action = order.action
details = msg.brokerd_msg details = msg.brokerd_msg
# TODO: some kinda progress system # TODO: some kinda progress system
@ -1077,7 +1077,9 @@ async def process_trade_msg(
), ),
) )
# TODO: how should we look this up? # TODO: append these fill events to the position's clear
# table?
# tracker = mode.trackers[msg['account']] # tracker = mode.trackers[msg['account']]
# tracker.live_pp.fills.append(msg) # tracker.live_pp.fills.append(msg)