parent
6a0848a3a9
commit
022f85095e
@ -561,6 +561,8 @@ class Telegram(RPCHandler):
|
|||||||
for r in results:
|
for r in results:
|
||||||
r['open_date_hum'] = arrow.get(r['open_date']).humanize()
|
r['open_date_hum'] = arrow.get(r['open_date']).humanize()
|
||||||
r['num_entries'] = len([o for o in r['orders'] if o['ft_is_entry']])
|
r['num_entries'] = len([o for o in r['orders'] if o['ft_is_entry']])
|
||||||
|
r['num_exits'] = len([o for o in r['orders'] if not o['ft_is_entry']
|
||||||
|
and not o['ft_order_side'] == 'stoploss'])
|
||||||
r['exit_reason'] = r.get('exit_reason', "")
|
r['exit_reason'] = r.get('exit_reason', "")
|
||||||
r['stake_amount_r'] = round_coin_value(r['stake_amount'], r['quote_currency'])
|
r['stake_amount_r'] = round_coin_value(r['stake_amount'], r['quote_currency'])
|
||||||
r['profit_abs_r'] = round_coin_value(r['profit_abs'], r['quote_currency'])
|
r['profit_abs_r'] = round_coin_value(r['profit_abs'], r['quote_currency'])
|
||||||
@ -581,6 +583,7 @@ class Telegram(RPCHandler):
|
|||||||
if position_adjust:
|
if position_adjust:
|
||||||
max_buy_str = (f"/{max_entries + 1}" if (max_entries > 0) else "")
|
max_buy_str = (f"/{max_entries + 1}" if (max_entries > 0) else "")
|
||||||
lines.append("*Number of Entries:* `{num_entries}`" + max_buy_str)
|
lines.append("*Number of Entries:* `{num_entries}`" + max_buy_str)
|
||||||
|
lines.append("*Number of Exits:* `{num_exits}`")
|
||||||
|
|
||||||
lines.extend([
|
lines.extend([
|
||||||
"*Open Rate:* `{open_rate:.8f}`",
|
"*Open Rate:* `{open_rate:.8f}`",
|
||||||
|
@ -279,6 +279,7 @@ def test_telegram_status_multi_entry(default_conf, update, mocker, fee) -> None:
|
|||||||
assert msg_mock.call_count == 4
|
assert msg_mock.call_count == 4
|
||||||
msg = msg_mock.call_args_list[0][0][0]
|
msg = msg_mock.call_args_list[0][0][0]
|
||||||
assert re.search(r'Number of Entries.*2', msg)
|
assert re.search(r'Number of Entries.*2', msg)
|
||||||
|
assert re.search(r'Number of Exits.*0', msg)
|
||||||
assert re.search(r'Average Entry Price', msg)
|
assert re.search(r'Average Entry Price', msg)
|
||||||
assert re.search(r'Order filled', msg)
|
assert re.search(r'Order filled', msg)
|
||||||
assert re.search(r'Close Date:', msg) is None
|
assert re.search(r'Close Date:', msg) is None
|
||||||
|
Loading…
Reference in New Issue
Block a user