fixed flake8 and mypy errors

This commit is contained in:
Aezo Teo
2021-12-29 21:48:50 +08:00
parent b6092e2e3c
commit ee7cbcd69f
4 changed files with 7 additions and 6 deletions

View File

@@ -245,7 +245,7 @@ class RPC:
fiat_profit_sum = fiat_profit if isnan(fiat_profit_sum) \
else fiat_profit_sum + fiat_profit
trades_list.append([
trade.id + f' {direction_str}',
str(trade.id) + f' {direction_str}',
trade.pair + ('*' if (trade.open_order_id is not None
and trade.close_rate_requested is None) else '')
+ ('**' if (trade.close_rate_requested is not None) else ''),

View File

@@ -272,7 +272,7 @@ class Telegram(RPCHandler):
else:
msg['profit_extra'] = ''
is_fill = msg['type'] == RPCMessageType.SELL_FILL
message = [
message = "".join([
f"{msg['emoji']} *{msg['exchange']}:* ",
f"{'Exited' if is_fill else 'Exiting'} {msg['pair']} (#{msg['trade_id']})\n",
f"*{'Profit' if is_fill else 'Unrealized Profit'}:* ",
@@ -285,8 +285,7 @@ class Telegram(RPCHandler):
msg.get('leverage', None) is not None else "",
f"*Amount:* `{msg['amount']:.8f}`\n",
f"*Open Rate:* `{msg['open_rate']:.8f}`\n"
]
message = "".join(message)
])
if msg['type'] == RPCMessageType.SELL:
message += (f"*Current Rate:* `{msg['current_rate']:.8f}`\n"
f"*Close Rate:* `{msg['limit']:.8f}`")