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