Use cancel level logging for cancelled orders
parent
b0d3d9bb01
commit
5dc9a61ec4
|
@ -702,6 +702,9 @@ async def translate_and_relay_brokerd_events(
|
|||
# a live flow now exists
|
||||
oid = entry.oid
|
||||
|
||||
# TODO: instead this should be our status set.
|
||||
# ack, open, fill, closed, cancelled'
|
||||
|
||||
resp = None
|
||||
broker_details = {}
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ class BrokerdStatus(Struct):
|
|||
# XXX: should be best effort set for every update
|
||||
account: str = ''
|
||||
|
||||
# TODO: instead (ack, pending, open, fill, clos(ed), cancelled)
|
||||
# {
|
||||
# 'submitted',
|
||||
# 'cancelled',
|
||||
|
|
|
@ -843,16 +843,25 @@ async def process_trades_and_update_ui(
|
|||
# resp to 'cancel' request or error condition
|
||||
# for action request
|
||||
elif resp in (
|
||||
'broker_cancelled',
|
||||
'broker_inactive',
|
||||
'broker_errored',
|
||||
):
|
||||
# delete level line from view
|
||||
mode.on_cancel(oid)
|
||||
broker_msg = msg['brokerd_msg']
|
||||
log.error(
|
||||
f'Order {oid}->{resp} with:\n{pformat(broker_msg)}'
|
||||
)
|
||||
|
||||
elif resp in (
|
||||
'broker_cancelled',
|
||||
'dark_cancelled'
|
||||
):
|
||||
# delete level line from view
|
||||
mode.on_cancel(oid)
|
||||
broker_msg = msg['brokerd_msg']
|
||||
log.warning(
|
||||
f'Order {oid} failed with:\n{pformat(broker_msg)}'
|
||||
log.cancel(
|
||||
f'Order {oid}->{resp} with:\n{pformat(broker_msg)}'
|
||||
)
|
||||
|
||||
elif resp in (
|
||||
|
|
Loading…
Reference in New Issue