Revert another round of pointless changes
which even cause duplicate output in Total and Balance.
This commit is contained in:
parent
acab9df78b
commit
200d617679
@ -248,30 +248,16 @@ class Telegram(RPCHandler):
|
|||||||
|
|
||||||
if msg['type'] in [RPCMessageType.ENTRY_FILL]:
|
if msg['type'] in [RPCMessageType.ENTRY_FILL]:
|
||||||
message += f"*Open Rate:* `{msg['open_rate']:.8f}`\n"
|
message += f"*Open Rate:* `{msg['open_rate']:.8f}`\n"
|
||||||
total = msg['amount'] * msg['open_rate']
|
|
||||||
elif msg['type'] in [RPCMessageType.ENTRY]:
|
elif msg['type'] in [RPCMessageType.ENTRY]:
|
||||||
message += f"*Open Rate:* `{msg['limit']:.8f}`\n"\
|
message += f"*Open Rate:* `{msg['limit']:.8f}`\n"\
|
||||||
f"*Current Rate:* `{msg['current_rate']:.8f}`\n"
|
f"*Current Rate:* `{msg['current_rate']:.8f}`\n"
|
||||||
total = msg['amount'] * msg['limit']
|
|
||||||
if self._rpc._fiat_converter:
|
message += f"*Total:* `({round_coin_value(msg['stake_amount'], msg['stake_currency'])}"
|
||||||
total_fiat = self._rpc._fiat_converter.convert_amount(
|
|
||||||
total, msg['stake_currency'], msg['fiat_currency'])
|
|
||||||
else:
|
|
||||||
total_fiat = 0
|
|
||||||
message += f"*Total:* `({round_coin_value(total, msg['stake_currency'])}"
|
|
||||||
|
|
||||||
if msg.get('fiat_currency', None):
|
if msg.get('fiat_currency', None):
|
||||||
message += f", {round_coin_value(total_fiat, msg['fiat_currency'])}"
|
message += f", {round_coin_value(msg['stake_amount_fiat'], msg['fiat_currency'])}"
|
||||||
|
|
||||||
message += ")`"
|
message += ")`"
|
||||||
if msg.get('sub_trade'):
|
|
||||||
bal = round_coin_value(msg['stake_amount'], msg['stake_currency'])
|
|
||||||
message += f"\n*Balance:* `({bal}"
|
|
||||||
|
|
||||||
if msg.get('fiat_currency', None):
|
|
||||||
message += f", {round_coin_value(msg['stake_amount_fiat'], msg['fiat_currency'])}"
|
|
||||||
|
|
||||||
message += ")`"
|
|
||||||
return message
|
return message
|
||||||
|
|
||||||
def _format_exit_msg(self, msg: Dict[str, Any]) -> str:
|
def _format_exit_msg(self, msg: Dict[str, Any]) -> str:
|
||||||
|
@ -2003,8 +2003,7 @@ def test_send_msg_entry_fill_notification(default_conf, mocker, message_type, en
|
|||||||
'*Amount:* `1333.33333333`\n'
|
'*Amount:* `1333.33333333`\n'
|
||||||
f"{leverage_text}"
|
f"{leverage_text}"
|
||||||
'*Open Rate:* `0.00001099`\n'
|
'*Open Rate:* `0.00001099`\n'
|
||||||
'*Total:* `(0.01465333 BTC, 180.895 USD)`\n'
|
'*Total:* `(0.01465333 BTC, 180.895 USD)`'
|
||||||
'*Balance:* `(0.01465333 BTC, 180.895 USD)`'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user