Use cancel level logging for cancelled orders

kraken_ws_orders
Tyler Goodlet 2022-07-10 15:44:52 -04:00
parent b0d3d9bb01
commit 5dc9a61ec4
3 changed files with 16 additions and 3 deletions

View File

@ -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 = {}

View File

@ -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',

View File

@ -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 (